We are developing an application which uses xpages and a paged repeat control to display documents from a view.
By clicking on an individual row, the associated document is opened in another xpage.
On that document xpage, I have a link back to the xpage which displays the repeat control.
When we click that link, we are indeed returned back to the xpage which shows us the list of documents. However, we are returned back to the first page of that list.
I am sure that I’ve seen code somewhere which demonstrates how to open a specific page when opening an xpage with a paged control, but I can’t find it anywhere.
Can anyone shed some light on how to accomplish this, or point me to any documentation which explains how this is done?
Any assistance would be greatly appreciated.
Cheers!
T.
Subject: Partial solution…
A little more digging, and I found the original article I had read by John Mackey quite some time ago:
http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/XPages_tip_gotoPage_View_Pager
That helps me open a particular page represented by a pager on an xpage.
However, I’d like to save the current page when I open the document so that I can return to that page when I click the link on the document xpage.
I can’t seem to find out how to determine the current page I’m on to save it in something like a sessionscope variable to return to the current spot.
My code starts alright…
var pager:com.ibm.xsp.component.xp.XspDataIterator = getComponent(“pager1”);
I have tried to “print” different values out to the server console, but I can’t seem to find the right one.
This article also explains a few more parameters that I tried, but no such luck.
http://www.mydominolab.com/2010/10/repeat-control-better-navigation.html
Can anyone lend some insight?
Cheers! T.
Subject: Found it!
Using this IBM technical documentation, I was able to determine the classes that I needed to use to determine the page being displayed:
http://public.dhe.ibm.com/software/dw/lotus/Domino-Designer/JavaDocs/XPagesExtAPI/8.5.2/com/ibm/xsp/component/UIPager.PagerState.html
For anyone requiring the same sort of information, my code looks something like the following:
var pager:com.ibm.xsp.component.UIPager = getComponent(“pager1”);
var pState = pager.createPagerState();
print( pState.getCurrentPage() );
Hope this helps someone else.
Cheers, T.