XForms/Select All

WARNING THIS EXAMPLE IN DEVELOPMENT
= Motivation = You would like to be able to select all rows in a table using a single trigger.

= Approach = You can put a list of items in a table and have a single column that has a checkbox in it. You can then use the index function to change the selected item.

= Screen Image =

= Sample Program =       Select all list [n]         <xf:label>Unselect all list [n]</xf:label> <xf:action ev:event="DOMActivate"> <xf:setvalue ref="item[1]/@selected" value="'false'" /> <xf:setvalue ref="item[2]/@selected" value="'false'" /> <xf:setvalue ref="item[3]/@selected" value="'false'" /> <xf:setvalue ref="item[4]/@selected" value="'false'" /> </xf:action> </xf:trigger>

<xf:trigger> <xf:label>Select all repeat</xf:label> <xf:action ev:event="DOMActivate"> <xf:repeat nodeset="item" id="repeat-id-2"> <xf:setvalue ref="@selected" value="'true'" /> </xf:repeat> </xf:action> </xf:trigger> <xf:trigger> <xf:label>Unselect repeat</xf:label> <xf:action ev:event="DOMActivate"> <xf:repeat nodeset="item" id="repeat-id-3"> <xf:setvalue ref="@selected" value="'false'" /> </xf:repeat> </xf:action> </xf:trigger> <ol> <xf:repeat nodeset="item" id="repeat-id-4"> <li> <xf:output ref="@selected" /> </li> </xf:repeat> </ol>

Discussion
Note that the setvalues inside the repeat blocks do not work. I have tried to use the current function inside the repeat like this:

but with no luck.

If anyone knows how to get this working, please let us know. Thanks - Dan

Alternate Way
Note: <xf:repeat> does not work inside <xf:action>. Here is the workaround for this.