This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
what i need is that when a user choose a country, automaticaly can add a cities based in the country, but I don't find an attribute in the selectOneMenu as the action of the comandButton that triggers an event and so i can load the cities.
How can launch an event from the selectOneMenu when chosen country?
The reason you couldn't find anything is that until JSF 2, there wasn't any pretty way to do that.
JSF is built on HTTP and HTTP is not a continuous-conversation protocol. In other words, when you change control values, no actual network communications occur between client and server until an actual form submit is done. That is, the user clicks on a commandButton or commandLink.
But submitting an entire page is slow and ugly.
To make things more friendly, what's needed is AJAX. AJAX allows submitting just part of the page and in response updating only part(s) of the page. In particular, you'd want to update the child selection control based on the selection of the parent selection control.
I have found that the easiest way to get a dependent list control to follow changes to its parent selection is to write the "get" accessor for the child control's selectItems in a way where if there's no current list of selectitems, a list is created based on whatever the parent selection is. So what I do is make the value "set" method for the parent invalidate the child selectItem list, which causes a new, updated selectItem list to be built when the child control is re-rendered. It's also important when doing this to reset the current selection value for the child control, since the original selection value may not be referring to a valid value in the new selection list.
Customer surveys are for companies who didn't pay proper attention to begin with.