xforms:select1 - writing to different nodes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xforms:select1 - writing to different nodes

c.harder
Hi,
is there a way for writing one value to diffrent nodes.

example:
<myform>
<person1>
</name>
</person1>
<person2>
</name>
</person2>
</myform>

<xforms:select1 ref="/myform" appearance="minimal">
<xforms:item id="item1">
<xforms:label>name1</xforms:label>
<xforms:value>name1</xforms:value>
</xforms:item>
<xforms:item id="item2">
<xforms:label>name2</xforms:label>
<xforms:value>name2</xforms:value>
</xforms:item>
</xforms:select1>

If I select "item1", it should write "name1" to element <name> of <person1> and <person2>. So in the end the instance should look like that:

<myform>
<person1>
<name>name1</name>
</person1>
<person2>
<name>name1</name>
</person2>
</myform>



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: xforms:select1 - writing to different nodes

Alessandro  Vernet
Administrator
One way of doing this is to bind your control to the first node
(/myform/person1/name) and have the value of the second node computed
based on the first by adding an <xforms:bind> in your model:

<xforms:bind nodeset="/myform/person2/name" calculate="/myform/person1/name"/>

Alex

On 11/16/05, [hidden email] <[hidden email]> wrote:

> Hi,
> is there a way for writing one value to diffrent nodes.
>
> example:
> <myform>
> <person1>
> </name>
> </person1>
> <person2>
> </name>
> </person2>
> </myform>
>
> <xforms:select1 ref="/myform" appearance="minimal">
> <xforms:item id="item1">
> <xforms:label>name1</xforms:label>
> <xforms:value>name1</xforms:value>
> </xforms:item>
> <xforms:item id="item2">
> <xforms:label>name2</xforms:label>
> <xforms:value>name2</xforms:value>
> </xforms:item>
> </xforms:select1>
>
> If I select "item1", it should write "name1" to element <name> of <person1> and <person2>. So in the end the instance should look like that:
>
> <myform>
> <person1>
> <name>name1</name>
> </person1>
> <person2>
> <name>name1</name>
> </person2>
> </myform>
>
>
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet