Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ValuechangeListener does not change the value

 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have two drop down menus, each bounded to a property in bean (integer)

Now I have a valueChangeListener on menu1 which changes the value of menu2 and disables it.

Everything works fine onchange of menu1 it changes the integer value of
menu2 and disables it but it does not change the selected value in
menu2 according to newly set integer value.

This my jsf code



And here is my valueChangeListener code




I also have set and get method for both the fields.

Am I still missing any thing?

Thanks
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you ever find the solution to your problem??
Any clue appreciated.
Julien.
 
Tom Fulton
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a number of problems with ValueChangeListeners in JSF until I spend several days figuring out what's happening "under the hood". The documentation is inadequate, and some of the better books are just plain wrong. I wrote up some information about this here. The part that might be affecting your application is this:
If you want a component to directly update the appearance of another component, both must have their immediate attribute set to �true� or the behavior is �unspecified��which means it doesn�t work, at least in the RI. And again, the form must be submitted (absent any Ajax processing to do so)
. Based on what I was seeing in your code, I don't think both components are set to "immdiate='true'"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic