I've got a collection of beans ("roles") containing user authorization
roles that I'm using as the Model for a ListView. I'm confused by the
interaction between CheckGroups, Check's and CheckBox's. If I use
CheckBox my roles show up selected if the user has the role, but I can't
get the Model Object when I submit. If I use Check the roles the user
has do not show up selected, but I get the Model Object after I submit.
My code for creating the CheckGroup ListView:
rolesGroup = new CheckGroup("rolesGroup", roles);
add(rolesGroup);
ListView rolesList = new ListView("roleList", roles) {
protected void populateItem(ListItem item) {
item.add(new CheckBox("roleCheck", new
PropertyModel(item.getModel(), "hasRole")));
item.add(new Label("gwGrpDesc", new
PropertyModel(item.getModel(), "Description")));
item.add(new Label("gwGrpId", new
PropertyModel(item.getModel(), "GroupId")));
}}.setReuseItems(true);
rolesGroup.add(rolesList);
rolesGroup.add(new
CheckGroupSelector("rolesGroupSelector"));
And getting the model object in onSubmit():
List userRoles = (List) rolesGroup.getModelObject();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]