This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ValueChangeListener Tag doesn't work

 
marwa talaat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic