Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Many check box daynamics  RSS feed

 
hassan ali
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

how can i have Many check box dynamically

in jsp

it was loop around <input TYPE=checkbox name=accommodation VALUE=Rugby> tag


according to result from search in database in table accommodation




how this can be done in JSF?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest general-purpose way is to create a model class which contains a boolean property to capture the UI state, build up a List of those model objects (table rows), wrap it in a ListDataModel, then present the checkboxes as a dataTable:


I don't guarantee the above is 100% correct, but that's the general Idea.

Another, simpler way can be used if you just want a straight-up list of checkboxes arranged horizontally or vertically. Use the "selectManyCheckbox" control and create a list of SelectItems containing the checkbox captions and the values that will be inserted into the selectManyCheckbox value list when the corresponding item is checked.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!