xforms:input in more than one instance
- This may be a stupid question, but...
does anybody knows how to take data from a single xforms:input and put it in more than one instance?
We have tried to use the "|" in the ref="..." attribute of the xforms:input, but it doesn't work well...
The "secondinstance" is a subset of the main instance and we need the same data (i.e. BuyerContact) in both instances to submit them in two different xml files. The submissions do their work: the "secondinstance" xml file has all the nodesets and the tags decleared in the "secondinstance" instance, but them are all empty or equal to the "secondinstance" initialization.
- Hello Alessio and Raoul (!),
> does anybody knows how to take data from a single xforms:inputFirst thing is that anything that uses @ref is binding to only one node
> and put it in more than one instance? We have tried to use the
> "|" in the ref="..." attribute of the xforms:input, but it doesn't
> work well...
- so you can't use unions and such like.
However, I think that XForms actually has a more elegant model to do
what you want, and that is to use @calculate on an xf:bind. In your
case, all you need to do is make an xf:bind that makes the value of one
BuyerContact equal to the value of the other (place this inside your
Any time the value in the second instance changes, the first will also
change. (See the Hello, World! sample on the formsPlayer site, too.)
Then you just connect the xf:input to the BuyerContact element that is
being linked to - in this case, the one in the second instance:
Note by the way that xf:label goes *inside* a form control!