3
votes

If a leave a xpage open in the browser for a couple of hours, then when I come back and try to click on the pager (which does a partial refresh), it doesn't work. So how can I automatically detect this and force a full refresh? Is it possible at all?

2

2 Answers

5
votes

The answer depends on what you are trying to accomplish, and what you are willing to trade off to do it. The reason the partial refresh fails is because the user's XSP session has timed out, so the information about the particular user's page view has expired, and can not be just "made to work." What has to happen is you'll need to either devise and implement a way to maintain and reload the state of the page, which then has to be restored inside a new session, or the session needs to never expire in the first place. The second way is the easiest, and the first is very difficult. There is a setting on the XPages tab of the application settings that allows you to control the application's timeout. Set the value higher to allow the page to stay active longer. There is a trade off here for as the longer a session is in memory, the more memory that is required, which leads to reduced scalability. Alternatively you can build some some logic into the onError which would detect the failed partial refresh and then perform a full refresh to re-establish the session, but any session data would be lost.

2
votes

Look for xe:keepSessionAlive control in ExtLib. It will ping server periodically, so will keep your session alive.

Beware of performance problems in case of too many users keeping their browsers open.