fm:set-out – Action Attributes

Data items in edit mode can be runnable.

CONCEPTS

If you add namespace:run and namespace:action to an editable element, that action will run when the data changes.

EXAMPLES

Make a drop down run an action on change:

<xs:element name="DEPARTMENT" empdata:edit="." empdata:run="." empdata:action="action-onClick">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:enumeration value="ADMINISTRATION"/>
      <xs:enumeration value="FINANCE"/>
      <xs:enumeration value="SALES"/>
      <xs:enumeration value="HUMAN RESOURCES"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

EXERCISES

Please use your XX_EMPLOYEEMODULE (where XX are your initials) file for the following exercises.

Exercise 1

Add an element in the EMPLOYEE collection called “DEPARTMENT” and mark it up as above.

Exercise 2

Define an action, “action-onClick”, that pops up the alert “The Department is now DEPARTMENT_NAME”, where DEPARTMENT_NAME is the element’s new value.

Exercise 3

Run the module, and change Department to see the results.