wood burning stoves 2.0*
The moose likes JSF and the fly likes Change values in dropdown dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Change values in dropdown dynamically" Watch "Change values in dropdown dynamically" New topic
Author

Change values in dropdown dynamically

meraj zia
Greenhorn

Joined: Apr 17, 2009
Posts: 5
Hi,
I've two dropdowns on my jsf page.
I want to change the values of second one based on the value selected in the first. So once the user selects some values in dropdown 1 the values in dropdown 2 should be refetched.
How to do this?
Anil Gorthy
Greenhorn

Joined: Oct 30, 2008
Posts: 13
You should be able to achieve this w/ PartialTriggers (FYI, I use Apache Trinidad). Here is a snippet of my JSF code:

First ListBox:


Second ListBox:


Notice the second listbox: I have the partialTriggers attribute set to the id of the first listbox and in the backing bean whenever the user selects a value in the first listbox, this valuechange is captured and sent to populate the second box.

Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Change values in dropdown dynamically
 
Similar Threads
how to populate the dropdown using javascript
Problem in submitting values to be mapped to backing bean
JSF dropdown components problem
dropdown selection in Struts2
dropdown from database