xforms:toggleAdded by IBM on October 10, 2012 | Version 1 (Original)
|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.
Also supports the xforms:case element. If the xforms:case element is present, the case attribute of xforms:toggle is ignored.
<xforms:toggle event case="case"/>
Table 1. toggle parameters
|event||string||The XForms event that triggers the action.|
|case||string||The ID of the case to select.|
|XPath||XPath||An XPath expression that returns the ID of the case to select.|
Example The following button assumes that you have an xforms:switch with two cases: single and married. When clicked, the button sets the switch to the married case:
<xforms:toggle case="married" ev:event="DOMActivate"
- XFDL allows an xforms:switch option to appear inside an xforms:repeat option. In this case, the row index of the repeat determines which switch is affected by the xforms:toggle action.
For example, consider a case in which repeat X contains a switch, and repeat X begins with an index of 2. You toggle the case of the switch. To locate the correct switch, we first locate row 2 of the repeat, then locate the switch within that row.