这是我的一段代码。这行得通,我看到“rowdata 等于对象”日志语句,但现在我需要对“选定”行说,但据我所知,没有一种方法......我该如何做到这一点?
public void selectRows(){
Collection<Object> s = new ArrayList<Object>(getGroups());
log.debug("set the selection to the table");
table.getTable().walk(FacesContext.getCurrentInstance(), new DataVisitor() {
@Override
public DataVisitResult process(FacesContext context, Object rowKey,
Object argument) {
log.debug("entered walk");
Collection<Object> selection = (Collection<Object>) argument;
for(Object o : selection){
table.getTable().setRowKey(rowKey);
if(table.getTable().getRowData().equals(o)){
log.debug("rowdata equals object");
table.getTable().getSelection().add(o);
log.debug("size of selection is: " + table.getTable().getSelection().size());
}
}
table.getTable().setRowKey(rowKey);
return null;
}
}, s );
}