• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting multiple drop down list value from view using JSF 2.0

 
Hei Ching
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic