• Post Reply Bookmark Topic Watch Topic
  • New Topic

HtmlSelectOneMenu component  RSS feed

 
Hernan Tavella
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i have been trying different way to add a listener so when the user change the dropmenu it fire an action on server side, but i couldn't
This is the code.



Any suggestion?
Thank you.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF Rule #1: The more JSF-specific coding you're doing, the more likely you're doing it wrong.

In most cases, it is not necessary (or desirable) to connect to the grungy underside of the JSF component tree to attach a valueChangeListener. Just code it as a method reference in the View Template (xhtml). The actual listener method can then be done in mostly POJO code.

I have a suspicion based on your sample that you think that the server can reach out to the client and modify it. Since JSF is based on HTTP and HTTP can only respond to client requests and not send unsolicited data to a client, that is not possible. Nor does the client contain JSF-specific content. By the time it's shipped to the client, the JSF View has been converted to standard HTML.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!