You will have to make the view page remember its position by storing the number of the first row on the page in a scoped variable.
In the "beforeRenderResponse" event add the following code:
var c = getComponent("viewPanel");
if (c) {
sessionScope.put("viewFirst"+view.getPageName(), c.first);
}
if (c) {
sessionScope.put("viewFirst"+view.getPageName(), c.first);
}
"viewPanel" is the id of your view control of course.
And in the view control's All properties - first - add the code:
var vwFirst = sessionScope.get("viewFirst"+view.getPageName());
if (vwFirst) return vwFirst;
if (vwFirst) return vwFirst;
This will also work when displaying data tables through a repeat control.
Used sources:
xpageswiki.com
Used sources:
xpageswiki.com
5 comments:
You can also use the PagerState control in the Extension Library to do the same thing.
How is the sessionScope variable updated when you use the pager?
The pager control does a full update, so the beforeRenderResponse is executed on every page change.
The pager control does either full or partial update. The proposed solution only works with the full update.
Any idea how to make it work with partial update?
tried this on a repeat control but indeed, I need to perform a full update on it in order to have it working..
Post a Comment