user2539823
user2539823

Reputation: 103

Set value of output inside control in repeatable section

I have my own control, which has model with action which is executing when form is loaded:

<xf:model>
   <xf:action ... >
       <xf:setvalue ref="???" value="some_value"/> 
   </xf:action>
</xh:model>

I put this control to my xforms file to the repeatable section:

<section-3>
   <section-3-iteration>
       <my-control/>
       <output-control/>
   </section-3-iteration>
   <section-3-iteration>
       <my-control/>
       <output-control/>
  </section-3-iteration>
</section-3>

Now I want to reference to the output control from my control, I mean I want to set output-control value inside control. What should I write to ref attribute in setvalue in my control?

I tried to put there: ref="../output-control", but it doesn't work. When I write: ref="xxf:instance('fr-form-instance')//*[name() = 'output-control']" it set value od output-control only in first iteration.

regards

Upvotes: 0

Views: 232

Answers (1)

ebruchez
ebruchez

Reputation: 7857

It's a bit dangerous because it violates encapsulation. But if you really need to, try:

ref="xxf:binding('my-binding')/../output-control"

where my-binding refers to your custom control's id attribute on xbl:binding:

<xbl:binding id="my-binding" xxbl:mode="binding" ...>

Upvotes: 1

Related Questions