1
votes

I have a Xpage that performs a partial refresh when a user selects a value in a combobox (onChange event). The combobox is actually a filter selector for a custom view component. This event triggers some SSJS code and performs a partial refresh. This event breaks occasionaly, probably due to XPages session being removed. The partial refresh is executed but the SSJS code that sets the viewScope variables is no longer executed. This results in the view showing all data without filter applied.

I added a print statement as the first line of the ssjs function. This print statement no longer executed.

I managed to reproduce this by restarting http with the page open.

Looking at the network tab in Chrome devtools shows status 200 on the partialRefreshPost. Also the partialrefresh id seems correct.

Any explanation?

1
Sounds like session time out. Did you tried to use the <xe:keepSessionAlive> from the extlib? When you restart the http you drop every http session. So every one who is visiting your XPage will have to refresh the entrie page.Michael Saiz
Hi Michael, the keepSessionAlive control is on the page. Also a XSP.partialRefreshPost is executed every 5 minutes as a manual keep alive.BvG013

1 Answers

5
votes

This happens if the session times out, the server was restarted and/or the the application was rebuild.

If a partial refresh is then posted to the server, it is like a HTTP GET based request: The persisted view of your current XPage is "waked up again" but some the JSF lifecycle phases are skipped (3, 4, 5). SSJS code for partial refreshs is executed in the skipped phases, that's why there is no print out on your console.

[This is a very short explanation. For more information please check the XPages Master Classes Videos about the JSF lifecycle and it's details]