I have a table that I have defined wit <xf:repeat> after I have defined a template and a button to add a new row to this table that in the same time open a panel in order to define all the values for this new row and at the end of the page you have e button OK to save it (i don't want for now to come back to the server but just to modify the xml that i have) I attached to you a draft about an xform file that I'm composing
in particular you can search in the code the ADD button
<xf:trigger> <xf:label>New Point Of Reference</xf:label> <xf:action> <xf:insert at= "index('ri')" position= "after" origin= "instance('templateRefPoint')" context= "/RefPoints"/> <xf:toggle case= "showTab" ev:event= "DOMActivate" /> </xf:action> </xf:trigger>
and the button for saving
<xf:trigger class= "orderListAddTrigger"> <xf:label>OK</xf:label> <xf:hint>Adds a new point of reference</xf:hint> <xf:action ev:event= "DOMActivate"> <xf:setvalue ref= "instance('templateRefPoint')/@Type"/> <xf:refresh /> </xf:action> </xf:trigger>
Every suggestions about how to organize the code are well accepted!!!
The last thing is that I would like to organize the code importing some structure and customized them, I want to say a sort of template how can i perform it in xform avoiding to write the long file without the reusability of components ?