aspose file tools*
The moose likes JSF and the fly likes Getting multiple drop down list value from view using JSF 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Getting multiple drop down list value from view using JSF 2.0" Watch "Getting multiple drop down list value from view using JSF 2.0" New topic
Author

Getting multiple drop down list value from view using JSF 2.0

Hei Ching
Greenhorn

Joined: Dec 06, 2012
Posts: 1
I am trying to use JSF to retrieve multiple drop down lists according to user input from the view to controller.

However seems I cannot find the correct way.

As the drop down lists are generated dynamically, I cannot hard code the id / name of the drop down list.

Here is my code in the view:

I thought I could declare a List named studentSelections in the controller so that I could get all the user input of the drop down list, but seems I have failed.

So could anyone give a hand on it?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Welcome to the JavaRanch, Hei Ching!

If by "in the controller" you mean the backing bean (which isn't a Controller, it's the Model), you will find it a lot easier if you use a dataTable instead of a ui:repeat.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
Consider Paul's rocket mass heater.
 
subject: Getting multiple drop down list value from view using JSF 2.0