Hi Reiner,
I believe that a select component requires that when the picked value is
not null, it must be one of the values in the associated options.
You're not using javascript to change the value of the 2nd and 3rd menus
into something that isn't in their associated options are you?
Also: is this a typo (meyBean vs myBean)?
<f:selectItems value="#{meyBean.field2List}" />
Cheers,
Simon
Reiner K. Kappenberger wrote:
Hi folks,
I'm fighting a peculiar problem right now on a Web page with 3
selectOneMenu items. The first 2 of those are for allowing the user to
narrow down the 3rd drop down box (to prevent overly large drop down
lists). When using valueChangeListeners the drop down boxes are
populated just fine.
The problem arrises when submitting the form for storage. I'm getting
"Value is not a valid option" on the last 2 drop down lists. The second
one isn't even associated with any storage (since all I care about is
the value change event).
To illustrate here's the snipet from the page:
<h:outputLabel for="field1Input">
#{resources['fiel1Label']}
</h:outputLabel>
<h:selectOneMenu id="field1Input"
valueChangeListener="#{myBean.changeField1Listener}"
onchange="submit()"
converter="field1Converter" >
<f:selectItems value="#{myBean.field1List}" />
</h:selectOneMenu>
<h:message for="field1Input" styleClass="errors"/>
<!-- Select Model for Device -->
<h:outputLabel for="field2Input">
#{resources['field2Label']}
</h:outputLabel>
<h:selectOneMenu id="field2Input"
valueChangeListener="#{myBean.changeField2Listener}"
onchange="submit()"
converter="field2Converter" >
<f:selectItems value="#{meyBean.field2List}" />
</h:selectOneMenu>
<h:message for="field2Input" styleClass="errors"/>
<!-- Select SNR for Device -->
<h:outputLabel for="field3Input">
#{resources['field3Label']}
</h:outputLabel>
<h:selectOneMenu id="field3Input"
converter="field3Converter"
value="#{myBean.selectValue}" >
<f:selectItems value="#{myBean.field3List}"/>
</h:selectOneMenu>
<h:message for="field3Input" styleClass="errors" />
myBean contains the Listeners (that will do the DB query and fill the
value lists (ArrayList) for the drop down boxes. The whole thing is
running within Facelets if that makes a difference. As well I've
downloaded the nightly build from 12/17/05 to make sure it wasn't
already fixed. It looked a bit like the MYFACES-996 bug, but I'm not sure.
Thank you for any help or suggestions,
Reiner
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 12/16/2005