I am using an XForms' repeat to build up a table (very similar to http://wiki.orbeon.com/forms/doc/developer-guide/xforms-repeat). Each row should get a delete trigger to remove it. The following code does only delete the selected item, is it so开发者_C百科mehow possible to use the current repeat index as a value for at?
<xforms:delete nodeset="employees" at="index('employee-repeat')"/>
Thank you for your help!
If you have a delete trigger for every row, then you don't need to use the index()
function. Instead, just refer to the current node, as in:
<xforms:repeat nodeset="employees">
...
<xforms:trigger>
<xforms:label>Delete</xforms:label>
<xforms:delete ev:event="DOMActivate" nodeset="."/>
</xforms:trigger>
</xforms:repeat>
If you had just one trigger for the whole repeat (i.e. at the beginning and/or end of the table listing the employees), then you could use index()
to refer to the "current" employee. That means that users would first need to click somewhere on that employee to make it the current one, and then click on the button. This is a somewhat unusual web UI, and so I would rather have one delete button per employee or use checkboxes for users to select which employees they want to act on.
精彩评论