How to do h:selectManyCheckbox for each of rows in h:dataTable

I've tried to find out how I can make h:dataTable with one (selectBooleanCheckbox) or more chechboxes (selectManyCheckbox) for each of table row.

my Bean is:

private DataModel userModel =new ListDataModel();

private User user =new User();

publicvoid setUser(User u){

this.user = u;

}

public User getUser(){

return this.userr;

}

public DataModel getUsers(){

return this.userModel;

}

Please, help me.

[976 byte] By [red-ariesa] at [2007-11-27 11:25:16]
# 1

Each row represents one User. So, attach the values of the checkboxes to the User object.

public class User {

private boolean selectBooleanCheckboxValue;

private List<String> selectManyCheckboxValues;

// + getters + setters

}

BalusCa at 2007-7-29 16:03:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

but if for some reason I cannot add more fields for my Model? Is there any possibility to add Map<idRow, boolean> for dataTable or similar?

red-ariesa at 2007-7-29 16:03:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Why not? Well, you can just subclass the DTO and add new fields.

BalusCa at 2007-7-29 16:03:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...