super.processUpdates(context);
updateSheetState(context);
}
private void updateSheetState(FacesContext facesContext) {
SheetState state = getSheetState(facesContext);
if (state != null) {
// ensure sortActionListener
// getSortActionListener();
// state.setSortedColumn(sortActionListener != null ? sortActionListener.getColumn() : -1);
// state.setAscending(sortActionListener != null && sortActionListener.isAscending());
Map attributes = getAttributes();
//noinspection unchecked
final List<Integer> list = (List<Integer>) attributes.get(Attributes.SELECTED_LIST_STRING);
state.setSelectedRows(list != null ? list : Collections.<Integer>emptyList());
state.setColumnWidths((String) attributes.get(Attributes.WIDTH_LIST_STRING));
state.setScrollPosition((Integer[]) attributes.get(Attributes.SCROLL_POSITION));
attributes.remove(Attributes.SELECTED_LIST_STRING);
attributes.remove(Attributes.SCROLL_POSITION);
}
}