This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes SelectOneMenu - Validation Error: Value is not valid Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "SelectOneMenu - Validation Error: Value is not valid" Watch "SelectOneMenu - Validation Error: Value is not valid" New topic
Author

SelectOneMenu - Validation Error: Value is not valid

Diego Gomes Araujo
Greenhorn

Joined: Nov 01, 2010
Posts: 4
I'm having this problem!
I have two selectOneMenu
one with list of states
and other with a list of cities of selected state, this problem occurs this way.
I select the state then list the cities, but when submit my form, the bean that contains the id of my state and not load list of cities.
It's like the bean was created again!

the code below:

estadoBean


cidadeBean


administradorBean


administradores.xhtml


Anyone know how I can fix it?
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218

I am trying to remember. I had a whole load of trouble with this myself years ago. Given
two selectOneMenus, the first needs a value change listener which updates a list which is
stored in backing bean (obviously). The first selectOneMenu also needs a child f:ajax tag
which render= the 2nd selectOneMenu. I could never make this stuff work with request
scoped beans, but it does work with view scoped beans. It's a bit late and I can't go on
further now but I'll check back, this is however a basic pattern for getting this to work,
but I may well have forgotten something. Try it.

Brendan.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: SelectOneMenu - Validation Error: Value is not valid
 
Similar Threads
java.lang.ClassNotFoundException for my generic DAO
can anybody help ??
How to optimize code using JSF
How to set Default selection in h:selectOneMenu
Action Event