wood burning stoves 2.0*
The moose likes JSF and the fly likes selectonemenu does not update 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 "selectonemenu does not update" Watch "selectonemenu does not update" New topic
Author

selectonemenu does not update

Cesar Ruiz
Greenhorn

Joined: Nov 12, 2013
Posts: 1
selectonemenu does not update

i have problem, why not update my selectoneMenu, when y select one its.

I Have active Ajax ?? or whichs is the problem,

thanks



My ManagedBean is



Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959
    
  19

I'm not sure what the PrimeFaces version of selectOneMenu does differently than the stock JSF h:selectOneMenu, but I'm pretty sure it has AJAX built in, so the actual f:ajax tag wouldn't be necessary as long as you the the PrimeFaces AJAX options.

In either case, the recommended method is to define a valueChangeListener as an attribute of the selectOneMenu element itself. You can then remove the "listener" attribute from the AJAX tag (if you aren't using PrimeFaces AJAX).

You do need to activate AJAX for the onchange event, however. For the f:ajax element, that would be 'event="change"'. Otherwise the AJAX event won't fire.

In the valueChangeLisener, you should not attempt to return anything for the UI. All the listener has to do is reset the model and value properties of the dependent selectOneMenu control. You also don't have to test for the value change. If the value didn't change, the listener method will not be invoked.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: selectonemenu does not update
 
Similar Threads
Problem with selectOneMenu
p:selectOneMenu is not working
ORA-02291: integrity constraint, can not find parent key
"Fake" Dynamic Field to Form [using rendered]
dynamic div gets reset