• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Checkbox Group  RSS feed

Mark Gent
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am new to JSF and am trying to create a set of check boxes up froom my backing bean.

I currenty have a List of the records from my JPA enitity via my Local interface.

private RoleCodeLocal rcObj;
protected List<Rolecode> RolecodeLister;
this.RolecodeLister = rcObj.getAllItems();

public List<Rolecode> getRolecodeLister() {return this.RolecodeLister;}
public void setRolecodeLister(List<Rolecode> value){this.RolecodeLister = value;}

The data is only in 2 columns ID, and Name say. How do I now get this data set into a checkbox group?

<h:selectManyCheckbox disabledClass="selectManyCheckbox_Disabled"
styleClass="selectManyCheckbox" id="PartyRoles"></h:selectManyCheckbox>

I have set up a select item using a similar technique but then binding as below:

<h:selectOneMenu binding="#{pc_Create_addressbook.countryListID}" id="CountryID" value="#{pc_Create_addressbook.countryID}"></h:selectOneMenu>

public HtmlSelectOneMenu getCountryListID()
CountryListID = new HtmlSelectOneMenu();

final Collection<SelectItem> list = new ArrayList<SelectItem>();
for (Country c : CountryLister)
list.add(new SelectItem(c.getId(), c.getName()));
final UISelectItems items = new UISelectItems();
return CountryListID;

Is there a similar method for checkboxes?


Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!