Calculate toggle@case?

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

Calculate toggle@case?

fl.schmitt
Hi,

is it possible to calculate the value of the toggle@case attribute? I'd like to toggle different cases depending on the result of a xpath function, for example:

xf:toggle case="if ((count(//foo) > 1), 'case1', 'case2'"

Is there a way to set the case dynamically?


Thank you
florian



--
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: Calculate toggle@case?

Ryan Puddephatt
Florian,

try

        <xforms:toggle case="case1" if="count(//foo) > 1"/>
        <xforms:toggle case="case2" if="not(count(//foo) > 1)"/>

Ryan


Ryan Puddephatt
Software Engineer

Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP

e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108

 

>-----Original Message-----
>From: [hidden email] [mailto:[hidden email]]
>Sent: 22 December 2006 13:43
>To: [hidden email]
>Subject: [ops-users] Calculate toggle@case?
>
>Hi,
>
>is it possible to calculate the value of the toggle@case
>attribute? I'd like to toggle different cases depending on the
>result of a xpath function, for example:
>
>xf:toggle case="if ((count(//foo) > 1), 'case1', 'case2'"
>
>Is there a way to set the case dynamically?
>
>
>Thank you
>florian
>
>



--
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: RE: Calculate toggle@case?

fl.schmitt
Hi Ryan,

> try
>
> <xforms:toggle case="case1" if="count(//foo) > 1"/>
> <xforms:toggle case="case2" if="not(count(//foo) > 1)"/>

works great, thanks a lot!

florian

--
http://www.florian-schmitt.net




--
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