This blog we will see how to reset the af:table pagination to predefine page.
Sometimes due to MDS the last visited page number will persist. we need to reset the old page number and set the new page number.
You can use the below code for rest the pagination
Thanks...
Sometimes due to MDS the last visited page number will persist. we need to reset the old page number and set the new page number.
You can use the below code for rest the pagination
DCIteratorBinding dcIter =
(DCIteratorBinding)(BindingContext.getCurrent().getCurrentBindingsEntry()).get("your
iterrator Name");
int taskIndex = 1; // It will
navigate to the page where 1st element exist.
int range =
dcIter.getRangeSize();
int oldStart =
dcIter.getRangeStart();
int newStart =
taskIndex-(taskIndex % range);
dcIter.getRowSetIterator().setRangeStart(newStart);
dcIter.setRangeStart(newStart);
RangeChangeEvent event = new
RangeChangeEvent(tableBinding, oldStart, oldStart+range, newStart,
newStart+range);
tableBinding.broadcast(event);
dcIter.getRowSetIterator().setCurrentRowAtRangeIndex(taskIndex
% range);
dcIter.setCurrentRowIndexInRange(taskIndex
% range);
AdfFacesContext.getCurrentInstance().addPartialTarget(tableBinding);
|
Thanks...