Dear all, I’m using Orbeon form builder and I’m
trying to set a button which allows form users to add single-line text
component in their form. I’ve seen many samples for this task
and the program is almost successful. Here is the code I use :
<xforms:model id="fr-form-model">
……
…..
<xforms:instance id="fr-form-instance">
<form>
<sectiondate>
<date/>
<button_ADDdate/>
</sectiondate>
</form>
</xforms:instance>
…….
</xforms:model> …. <xhtml:body> …..
<xforms:repeat nodeset="date">
<xforms:input bind="date-bind" incremental="true"
id="date-control">
<xforms:label ref="$form-resources/date/label"/>
</xforms:input>
</xforms:repeat>
</xhtml:td>
<xhtml:td>
<xforms:trigger>
<xforms:label
ref="$form-resources/button_ADDdate/label"/>
<xforms:insert ev:event="DOMActivate" nodeset="date"
at="1">
</xforms:insert>
</xforms:trigger> ….. </xhtml:body> The button does work. It adds the component
however, when a user want to set a value in one of the single-line text, the
others single-line text, added by the button ,automatically take the same value. I also tried to deal with instance and
template in my model and to use the attributes context and origin in the “xforms:insert”
but it still doesn’t work because I probably use a wrong code. Looking forward to get your responses. Thanks Ilan -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Ilan,
This is how <xforms:insert> is supposed to work: it copies the last node pointed by your nodeset, and copies it. To get around this, you need to either: * Reset the content of the nodes in the node you copied, after copying it (<xforms:setvalue ref="/path/to/node"/>). * Instead of copying the last node, copy a node from another "template" instance which you keep empty, and which is there just to be copied (this is what the <fr:repeat> does). Alex |
Free forum by Nabble | Edit this page |