.createState(context, grid);
state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
final SimpleSelection simpleSelection = grid.getSelection() == null ? new SimpleSelection()
: (SimpleSelection) grid.getSelection();
if (clientSelection.isReset() || clientSelection.isSelectAll()) {
simpleSelection.clear();
simpleSelection.setSelectAll(clientSelection.isSelectAll());
}
try {
grid.walk(context, new DataVisitor() {
public void process(FacesContext context, Object rowKey,