Data items in edit mode can be runnable.
If you add namespace:run and namespace:action to an editable element, that action will run when the data changes.
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>
Please use your XX_EMPLOYEEMODULE (where XX are your initials) file for the following exercises.
Add an element in the EMPLOYEE collection called “DEPARTMENT” and mark it up as above.
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.
Run the module, and change Department to see the results.