You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bruyn Bill <Br...@mcao.maricopa.gov> on 2006/06/08 00:40:11 UTC

RE: how to get the label of radio.

> 
> Hi Johnson,
> it's not possible to retrieve the LABEL of a selection list 
> (if not with an horrible and difficult trick : 
> widget.getSelectionList() to retrieve the selection list, the 
> selectionList.generateSaxFragment to stream the XML of the 
> selection list, then find the label inside it).

Thanks for the tip.

> 
> This is not because of a limitation in the framework, but 
> because acting in the flow basing on the LABEL of a selection 
> list is a bad practice and should not be done. Why not use 

IMO, I don't think you can assume that's what the intent is.  Maybe I
just need to include the label (along with the value, for argument's
sake) in some XML to be used in some future step.  E.g., for
presentation to an end user for confirmation.

> something more meaningful as a value of the selection list, 
> and then act in the flow based on the value (which is the 
> righ way of doing it)? For example :
> 
> <fd:selection-list>
>   <fd:item value = "in">
>     <fd:label>
>       <i18n:text>check-in</i18n:text>
>     </fd:label>
>   </fd:item>
>   <fd:item value = "out">
>     <fd:label>
>       <i18n:text>check-out</i18n:text>
>     </fd:label>
>   </fd:item>
> 
> 
> var val = form.lookupWidget('inout').getValue();
> if (val == 'in') {
> 
> } else if (val == 'out') {
> 
> }
> 
> 
> Simone
> 
> 
> johnson wrote:
> 
> >Hi!
> >
> >does anyone know how to get the label of a radio in flowscript when 
> >user choose a selection.
> >
> >ie:
> >
> ><fd:field id="inout">
> ><fd:label>
> ><i18n:text key="inout">inout</i18n:text>
> ></fd:label>
> ><fd:datatype base="string"/> <fd:initial-value>1</fd:initial-value>
> ><fd:selection-list>
> ><fd:item value = "1">
> ><fd:label>
> ><i18n:text>check-in</i18n:text>
> ></fd:label>
> ></fd:item>
> ><fd:item value = "2">
> ><fd:label>
> ><i18n:text>check-out</i18n:text>
> ></fd:label>
> ></fd:item>
> ></fd:selection-list>
> ></fd:field>
> >
> >here's a radio, when user choose 2, I want to get 
> check-out(or others 
> >depending on the i18n)
> >
> >Best regards
> >
> >johnson
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >  
> >
> -- 
> Simone Gianni
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

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