File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes how to change the values in h:selectOneMenu? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to change the values in h:selectOneMenu?" Watch "how to change the values in h:selectOneMenu?" New topic
Author

how to change the values in h:selectOneMenu?

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 56
<h:selectOneMenu value="#{newJSFManagedBean.month}">
<f:selectItems value=
"#{newJSFManagedBean.monthList}"/>
</h:selectOneMenu>

<h:selectOneMenu value="#{newJSFManagedBean.year}">
<f:selectItems value=
"#{newJSFManagedBean.dateList}"/>
</h:selectOneMenu>

how to change/refresh the values of date after month is selected? thanks


[Thumbnail for Untitled.jpg]

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

You must either require the user to click on a commandButton or commandLink to submit the form that contains those controls.

OR

You must attach AJAX functionality to the selectOneMenu controls so that they submit themselves.

Until the form data is submitted to the server, the server can do nothing.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
jQuery in Action, 2nd edition
 
subject: how to change the values in h:selectOneMenu?
 
Similar Threads
Setting the default drop-down list value
dyanmic dropdown
how to render a component based on condition
h:selectOneMenu breaking up in IE 9
Issue With selectOneMenu ValueChangeListener Not Firing