Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Many check box daynamics

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

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?
Saloon Keeper
Posts: 22479
Android Eclipse IDE Tomcat Server Redhat Java 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.
Won't you be my neighbor? - Fred Rogers. tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic