You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@recommind.com> on 2006/05/16 12:32:57 UTC

t:radio - (empty) Value is not a valid option

How can I set the value of a checkbox inside selectOneRadio to null or
empty?

<h:panelGroup>

<t:selectOneRadio id="multiDraft"
value="#{DynaAnnoControllerBean.multiAttributes['multiDraft']}"

                          style="width:auto;" layout="spread">

                        <f:selectItem itemLabel="yes" itemValue="bla1"/>

                        <f:selectItem itemLabel="no" itemValue="bla2"/>

                        <f:selectItem itemLabel="untouched"
itemValue=""/>

            </t:selectOneRadio>

                                   

            <t:radio for="multiDraft" index="0"/>

            <t:radio for="multiDraft" index="1"/>

            <t:radio for="multiDraft" index="2"/>

</h:panelGroup>                                   

                                   

I got the message "Value is not a valid option" when the 3rd option
"untouched" is selected. How can I set this value to null / empty?

<f:selectItem itemLabel="" itemValue=""/> inside a selectOneMenu is
working well.

 

Michael


RE: radio - (empty) Value is not a valid option

Posted by Julian Ray <ju...@yahoo.com>.
The itemValue is the value which will be returned when the form is posted.
Why not use a flag which indicates a an impossible (null) value which will
be processed and interpreted by your backing bean. I typically use Integer
returns and set Integer.MIN_VALUE as a null value flag.

  _____  

From: Michael Heinen [mailto:mhn@recommind.com] 
Sent: Tuesday, May 16, 2006 6:33 AM
To: MyFaces Discussion
Subject: t:radio - (empty) Value is not a valid option



How can I set the value of a checkbox inside selectOneRadio to null or
empty?

<h:panelGroup>

<t:selectOneRadio id="multiDraft"
value="#{DynaAnnoControllerBean.multiAttributes['multiDraft']}"

                          style="width:auto;" layout="spread">

                        <f:selectItem itemLabel="yes" itemValue="bla1"/>

                        <f:selectItem itemLabel="no" itemValue="bla2"/>

                        <f:selectItem itemLabel="untouched" itemValue=""/>

            </t:selectOneRadio>

                                   

            <t:radio for="multiDraft" index="0"/>

            <t:radio for="multiDraft" index="1"/>

            <t:radio for="multiDraft" index="2"/>

</h:panelGroup>                                   

                                   

I got the message "Value is not a valid option" when the 3rd option
"untouched" is selected. How can I set this value to null / empty?

<f:selectItem itemLabel="" itemValue=""/> inside a selectOneMenu is working
well.

 

Michael