• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

selectonemenu does not update

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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



 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic