• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

ValuechangeListener does not change the value

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you ever find the solution to your problem??
Any clue appreciated.
Julien.
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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'"
 
Where does a nanny get ground to air missles? Protect this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic