cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Trying to get a selectionlist label into a binding
Date Sat, 17 Apr 2004 21:00:13 GMT
On 16.04.2004 16:46, Nacho Jimenez wrote:

>> To clear up the picture:
>>
>> You have a form defined with a field widget and a selection list.
>>
>> You want to fill the selection list with an XML.
> 
> 
> No, that's easy and I already have taken care of it..
> 
> Right now my field widget is already a selection list populated with a 
> list of users... (sttatic version, for sake of simplicity)
> 
>        <wd:field id="user" required="true">
>            <wd:label>Usuario</wd:label>
>            <wd:datatype base="string"/>
>            <wd:selection-list>
>              <wd:item value="natz">
>                <wd:label>Nacho Jimenez</wd:label>
>              </wd:item>
>               <!-- etc -->
>              <wd:item value="otro">
>                <wd:label>Otro Distinto</wd:label>
>              </wd:item>
>            </wd:selection-list>
>        </wd:field>
> 
> What i need is to store the selection in an XML as:
> 
>    <user id="natz">Nacho Jimenez</user>
> 
>    The first binding is simple:
> 
>      <wb:value id="user" path="user/@id"/>
> 
>    But I just don't know how to do the second.. I guess it could be 
> something like:
>      <wb:javascript id="user" path="user" direction="save">
>         <wb:save-form>
>             widget.function.that.gets.the.selection's.label()
>        </wb:save-form>
>    </wb:javascript>
> 
>    Any idea?

The selection list is another dimension of a field and no value in the 
closer sense. So it's normally not bound to the field. The value of this 
field is only the selected value at the end.

So the normal way is setting the selection list via
<wd:selection-list src="cocoon:/users"/>
which calls another pipeline. In this pipeline you transform your custom 
XML to the wd:item syntax.

As already said you already bound the selected value of the field. And 
this happens via a standard
<wb:value id="user" path="where-ever-you-want-to-store-it"/>

Is this what you want?

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message