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

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 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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>  
>
-- 
Simone Gianni

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to