DataTablePaginatorAction action = new SelectPageActionInInput(newPageIndex);
action.execute(table);
}
public static void executePaginationAction(FacesContext context, DataTable table, String actionStr) {
DataTablePaginatorAction action;
if ("selectNextPage".equals(actionStr))
action = new SelectNextPageAction();
else if ("selectPrevPage".equals(actionStr))
action = new SelectPreviousPageAction();
else if ("selectFirstPage".equals(actionStr))
action = new SelectFirstPageAction();
else if ("selectLastPage".equals(actionStr))
action = new SelectLastPageAction();
else if (actionStr.startsWith(SELECT_PAGE_NO_COMMAND)) {
String pageNoStr = actionStr.substring(SELECT_PAGE_NO_COMMAND.length());
int pageNo;
try {
pageNo = Integer.parseInt(pageNoStr);
} catch (NumberFormatException e) {
return;
}
action = new SelectPageNoAction(pageNo);
} else {
Log.log(context, "Unknown DataTablePaginator action came from client: " + actionStr);
return;
}
action.execute(table);
}