toggle element for select1's item ?

View: New views
3 Messages — Rating Filter:   Alert me  

toggle element for select1's item ?

by Lucas J. González :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I was wondering if there is an effective way of replacing a
set of triggers (which toggles a switch) with a select1 element?

Perhaps by using events?

Thanks,

--
·
·    Grupo OPENTIA
·   (GPG: 1024D/36C7E8FC)
·
·
·                O P E N T I A
·    Interoperabilidad y soluciones abiertas
·               www.opentia.com
·
--


signature.asc (204 bytes) Download Attachment

Re: toggle element for select1's item ?

by Swithun Crowe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

LJG Hi, I was wondering if there is an effective way of replacing a set of
LJG triggers (which toggles a switch) with a select1 element?

You could have a series of xf:group elements instead of xf:case elements.
Each xf:group is bound to the same node that the select1 is, but each
specifies that the node has a different value. Something like:

<xf:select1 ref="selectNode">
...
</xf:select1>

<xf:group ref="selectNode[.='val1']">
...
</xf:group>

<xf:group ref="selectNode[.='val2']">
...
</xf:group>

Only one (or none) can be relevant at the same time, so this can be used
to hide the others.

I hope this gives you some ideas.

Swithun.


Re: toggle element for select1's item ?

by Erik Bruchez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lucas,

Here is a simple solution:

http://pastie.org/559039

Note that it requires support for the XForms 1.1 nested case element,
or support for AVTs on the case attribute.

-Erik

On Tue, Jul 21, 2009 at 2:31 PM, Swithun
Crowe<swithun@...> wrote:

> Hello
>
> LJG Hi, I was wondering if there is an effective way of replacing a set of
> LJG triggers (which toggles a switch) with a select1 element?
>
> You could have a series of xf:group elements instead of xf:case elements.
> Each xf:group is bound to the same node that the select1 is, but each
> specifies that the node has a different value. Something like:
>
> <xf:select1 ref="selectNode">
> ...
> </xf:select1>
>
> <xf:group ref="selectNode[.='val1']">
> ...
> </xf:group>
>
> <xf:group ref="selectNode[.='val2']">
> ...
> </xf:group>
>
> Only one (or none) can be relevant at the same time, so this can be used
> to hide the others.
>
> I hope this gives you some ideas.
>
> Swithun.
>
>