XForms actionsAdded by IBM on August 8, 2013 | Version 1 (Original)
|XForms actions are similar to the XFDL actions you can create using the action item. XForms actions allow you to initiate a number of processes, including submitting a form, setting a value in a form, inserting a row in a repeat table, and so on.
Unlike XFDL action items, XForms actions are triggered by events in the form. For example, you might create an action that occurs when the user clicks a button, when a particular value in the form has changed, or when a submission has returned an error.
This section provides general information about actions, and then details each action type in turn.
Actions are written in two ways, depending on whether you want to use a group of action or a single action.
Actions that include an XPath reference may also use XForms functions to resolve that reference.
The placement of actions depends on the triggering event.
Deletes a row of elements from a table. The elements are first deleted from the XForms model, then the table's repeat deletes the visible items that were linked to those data elements.
Dispatches a pre-defined or custom event to an XForms element indicated by an ID.
Adds a row of elements to a table. This function copies a row of elements in the data model, then inserts the copy in the desired location in the data model. Once the copy is inserted in the data model, the table's repeat creates corresponding items that are displayed to the user.
Sets a message that is displayed to the user in a small dialog box.
Causes the form viewing application to rebuild any internal data structures that are used to track computational dependencies within a particular model.
Causes the forms viewing application to recalculate any instance data that is affected by computations and is not up-to-date. This affects all data instances in the designated model.
Causes the forms viewing application to update all user interface elements linked to a particular model, so that they match the underlying data in the XForms model.
Returns a particular XForms model to the state it was in when the form was opened. This allows the user the reset the contents of the form to their "starting point", which can increase usability of the form.
Causes the forms viewing application to validate all instance data in a particular model, ensuring that all validation checks have been performed.
Triggers an XForms submission. The submission must already be defined in the XForms model.
Sets the focus to a particular presentation element in the form.
Sets the index for the xforms:repeat element in a table. This determines which row in the table receives the focus.
Sets the value for a specified element in the data model.
Selects one of the cases in an xforms:switch and makes it active. When one case is selected, all other cases in the switch are deselected.