xforms:triggerAdded by IBM on August 8, 2013 | Version 1 (Original)
|Triggers an event in response to an XFDL action or the user clicking an XFDL button. The event is expressed as an XForms action, which allow you to make various changes to the form. For example, you could use an XForms action to set which case in a switch statement is true, or you could us an XForms action to insert or delete items on the form.
Table 1. xforms trigger parameters
|single node binding||string||optional. See Single node binding. Adding a single node binding to an xforms:trigger does not cause the trigger to share data with the bound node. It simply allows the trigger to inherit the relevant properties from the data model.|
|label text||string||sets the text that the button containing the trigger displays, as well as the default accessibility message for that button. If the button also has value or acclabel options, they will override this setting.|
|XForms Action||(see the following)|
|Alert, Hint, Help Setting||metadata||see Metadata sub-options.|
XForms Action The XForms action determines what type of action is actually triggered. This could be a single action, such as deleting a data node, or multiple actions, such as setting the value of multiple data nodes. For more information about using XForms actions, refer to XForms actions.
Available in action, button
Example The following example shows a button that toggles the case of a switch item. In this case, the toggle sets the basic case to be true. Note that this trigger does not include a ref attribute, since the button is always relevant.
<xforms:toggle case="basic" ev:event="DOMActivate"
- The xforms:trigger option triggers XForms actions through the DOMActivate event. For more information about actions, refer to XForms actions . For more information about events, refer to XForms event handlers.
- A button or action that contains the trigger to type must be of type select, which is the default if the type is omitted. Any other type will override the trigger.
- An xforms:trigger does not set the triggeritem option for the form. If this is required, you must add a compute that will set the option when the button or action is activated.