Selecting nodes on xforms:repeat

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

Selecting nodes on xforms:repeat

Mauno
Hi,
Is it possible to select only some nodes when using xforms:repeat?

Let's say I have list of people in instance
<peoples>
  <people type="1" firstName="John1" lastName="Test1" saved="true"/>
  <people type="2" firstName="John2" lastName="Test2" saved="true"/>
  <people type="1" firstName="John3" lastName="Test3" saved="false"/>
</peoples>
And I want to xforms:repeat only people-nodes where @type="1".

Another question: Lets say every repeat produces xforms:output. How do I set row to produce xforms:input if and only if saved attribute is "false"?


Reply | Threaded
Open this post in threaded view
|

Re: Selecting nodes on xforms:repeat

Alexander Žaťko
1) did you try: <xforms:repeat nodeset="peoples/people[@type='1']"> ?
2) you can use the same XPath filtering trick in combination with the  
xforms:group element:

<xforms:group ref=".[@saved='true']">
     <xforms:output ref="@lastName"/>
</xforms:group>

<xforms:group ref=".[@saved='false']">
     <xforms:input ref="@lastName"/>
</xforms:group>

A.

On Jan 14, 2008, at 4:32 PM, Mauno wrote:

>
> Hi,
> Is it possible to select only some nodes when using xforms:repeat?
>
> Let's say I have list of people in instance
> <peoples>
>  <people type="1" firstName="John1" lastName="Test1" saved="true"/>
>  <people type="2" firstName="John2" lastName="Test2" saved="true"/>
>  <people type="1" firstName="John3" lastName="Test3" saved="false"/>
> </peoples>
> And I want to xforms:repeat only people-nodes where @type="1".
>
> Another question: Lets say every repeat produces xforms:output. How  
> do I set
> row to produce xforms:input if and only if saved attribute is "false"?
>
>
>
> --
> View this message in context: http://www.nabble.com/Selecting-nodes-on-xforms%3Arepeat-tp14803689p14803689.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws


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

Re: Selecting nodes on xforms:repeat

Mauno
Thats exactly what I was looking for, thanks!

Alexander Zatko wrote
1) did you try: <xforms:repeat nodeset="peoples/people[@type='1']"> ?
2) you can use the same XPath filtering trick in combination with the  
xforms:group element:

<xforms:group ref=".[@saved='true']">
     <xforms:output ref="@lastName"/>
</xforms:group>

<xforms:group ref=".[@saved='false']">
     <xforms:input ref="@lastName"/>
</xforms:group>

A.

On Jan 14, 2008, at 4:32 PM, Mauno wrote:

>
> Hi,
> Is it possible to select only some nodes when using xforms:repeat?
>
> Let's say I have list of people in instance
> <peoples>
>  <people type="1" firstName="John1" lastName="Test1" saved="true"/>
>  <people type="2" firstName="John2" lastName="Test2" saved="true"/>
>  <people type="1" firstName="John3" lastName="Test3" saved="false"/>
> </peoples>
> And I want to xforms:repeat only people-nodes where @type="1".
>
> Another question: Lets say every repeat produces xforms:output. How  
> do I set
> row to produce xforms:input if and only if saved attribute is "false"?
>
>
>
> --
> View this message in context: http://www.nabble.com/Selecting-nodes-on-xforms%3Arepeat-tp14803689p14803689.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org  
> mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws



--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws