Search code examples
xmlxformsxforms-betterform

(XForms) Select node in nodeset repeater automatically by clicking a button


I use XForms with betterFORM to realize forms in an HTML document. I implemented a nodeset repeater in a table. Now I want to realize that there is automatically selected a particular node in this repeat table by clicking a button. Is that possible?


Solution

  • The setindex action allows you to "mark a specific item as current in a repeating sequence". You can run it upon form load for example with:

    <xf:setindex
        ev:event="xforms-ready"
        repeat="my-repeat"
        index="2"/>