Any Xpages application update in design causes the application refresh which removes scope variables, session etc. When this occures and there is a page opened in users browser with some partial refresh action buttons ... such buttons simply do nothing when clicked which is quite confusing. No message that's warning the user that the page is stale or something. Is there a way how to detect such situation in general so I can inform user in browser with some dialog that he should reload the entire page?
Asked
Active
Viewed 540 times
0
-
At least in Firefox you should get a message that the partial update was not succesfull (dont know the message text atm). To prevent this you could use a client side Javascript wich does a Ajax request to your server every xy secounds to check if the Server has the page still in memory. Otherwise it should relolad the full page. But i recoment just dont update design while users are working with your page =) – Michael Saiz Nov 28 '13 at 15:10
-
1Duplicate: http://stackoverflow.com/questions/19115096/xpages-partial-refresh-cant-save-after-replicate-local-replica – Panu Haaramo Nov 28 '13 at 15:42
1 Answers
0
For all scope variables above request (which gets initialized when you send a request and is always shiny and new) you never can take their existence for granted. Best example: user leaves a form open, locks the PC, goes for lunch, lets the session expire (which also deletes the view scope). (S)he comes back, opens a new tab and logs in - so there is a valid (new) session, hits submit in the first tab -> bum all your code fails. This is the same scenario as an updated design short of the scenario Panu was pointing to.
So in your code check for the existence of your scoped variables and force a full refresh. Or (I like that better) add an error to the page so that gets displayed with an appropriate action.
-
2How to detect this for partial refresh (POST method) ? In browser I can see that server response status is 200 (OK) despite the fact the app has been refresh and the action doesnt work ... – David Marko Nov 29 '13 at 13:28
-
If you add an error to the faces context that could work - or let your code fail – stwissel Nov 30 '13 at 04:35