This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes ValueChangeListener Tag doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "ValueChangeListener Tag doesn Watch "ValueChangeListener Tag doesn New topic
Author

ValueChangeListener Tag doesn't work

marwa talaat
Greenhorn

Joined: Dec 28, 2011
Posts: 2
I have a three files index.xhtml,EventsBean.java (Managed Bean) and ValueChangeClass.java



My bean


The class that implements ValueChangeListener


It doesn't work ! Is this way to call setCapital() method right ?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15958
    
  19

The more complicated and more JSF-specific your code is, the more likely you're not doing it right. Consider that as the #1 rule for JSF. JSF is designed to do as much for you as possible and do it automatically.

In the case of setting the EventBean's country property, you can discard the valueChangeListener entirely. JSF will automatically invoke the EventBean's setCapital(). Provided of course, that your form does not contain any invalid data in it. When in doubt, add an "<h:messages/>" element to the page.

Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: ValueChangeListener Tag doesn't work
 
Similar Threads
how to view all the names that exists in the file using an scroll or trying the name in emulator
Populating dropdown menu based on another
An article from BBC.
Use multiple scopes in a page?
Something missing with dynamic faces (Ajax) simple example