form runner repeat nodeset
Posted by bsteuhl on
URL: https://discuss.orbeon.com/form-runner-repeat-nodeset-tp1476836.html
I am coding an xforms:repeat in form builder and runing it in form runner. When I click the trigger to insert a row, the rows always double? So for example, after the first insert, row count goes from 1 to 2. After second insert, row count goes from 2 to 4. After third insert, row count goes from 4 to 8. Also, in the wiki insert documentation, when I follow the context - origin - nodeset instructions it does not work in form runner. When I switch the what you say should be the origin to context and context to origin rows are inserted, but unfortunately always doubled. Why does this happen. I followed you format in other forms outside of form builder with no problems?
I have used xforms:repeat and xforms:insert countless times outside of form builder/runner. Am I doing something wrong inside form builder? I was under the impression that when you use form runner, anything not supported by form runner would still work as it gets passed to the xforms engine? Is this correct? Thank you.
Here are the two instances. In fr-form-instances I added the services nodeset. The template instance is so named. The trigger is also copied. Thank you.
<xforms:instance id="fr-form-instance">
<form xmlns="">
<section-1>
<control-1/>
<control-15/>
<control-3/>
<control-14/>
<control-5/>
<control-6/>
<control-7/>
<control-8/>
<control-9/>
<control-10/>
<control-11/>
<control-12/>
<control-13/>
</section-1>
<section-2>
<control-26/>
<control-27/>
<control-16/>
<control-17/>
<control-18/>
<control-19/>
<control-20/>
<control-21/>
<control-22/>
<control-23/>
<control-24/>
<control-25/>
</section-2>
<section-3>
<control-29/>
<control-30/>
<services>
<service>
<distanceService/>
<distanceQty/>
<distanceMRC/>
<distanceNRC/>
<dialtoneService/>
<dialtoneQty/>
<dialtoneMRC/>
<dialtoneNRC/>
</service>
</services>
</section-3>
<section-4/>
<section-5/>
</form>
</xforms:instance>
<xforms:instance id="service_template">
<service xmlns="">
<distanceService/>
<distanceQty/>
<distanceMRC/>
<distanceNRC/>
<dialtoneService/>
<dialtoneQty/>
<dialtoneMRC/>
<dialtoneNRC/>
</service>
</xforms:instance>
<xforms:trigger>
<xforms:label>Insert</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:insert context="instance('fr-form-instance')/section-3/services" origin="service" nodeset="instance('service-template')" at="1" position="after" />
</xforms:action>
</xforms:trigger>