0
votes

I have a requirement where i have two instances: instance1:

<some >
<Element12/>
<Element123/>
<example>
    <tree id="qw" show="true">
        <label>This tree</label>
    </tree>
    <tree id="as" show="true">
        <label>This is tree</label>
    </tree>
</example>

instance2:

<data>
<SomeElement/>
<example>
    <tree id="qw" show="true">
        <label>This tree</label>
    </tree>
    <tree id="as" show="true">
        <label>This is tree</label>
    </tree>
</example></data>

depending on the inputs i will submit one instance. There are set of question with yes and no radio buttons. These inputs i have to bind to both the instances. Currently i have binded one of the instance to the radio button

  <xf:repeat id="fl" nodeset="instance('instance1')/some/example/tree">
    <xf:select1 ref="@show" >
      <xf:label><xf:output ref="../label"  /></xf:label>
      <xf:item>
        <xf:label>yes</xf:label>
        <xf:value>true</xf:value>
      </xf:item>
      <xf:item>
        <xf:label>No</xf:label>
        <xf:value>false</xf:value>
      </xf:item>
    </xf:select1>
  </xf:repeat>

That instance is working fine. For another instance i am trying to bind like this:

<xf:repeat nodeset="instance('instance2')/example/tree">
        <xf:bind ref="@show" calculate="instance('instance1')/some/example/tree/@show"/>
    </xf:repeat>

This is not working.

1

1 Answers

0
votes

The problem solved by using xforms insert while doing the submission i have copied the element of first instance to the second instance:

<xf:insert nodeset="instance('instance2')/example" origin="instance('instance1')/some/example" />

This copied the whole example element from the binded instance to the unbinded.