|Re: How to restore UISession? [message #1039965 is a reply to message #1039933]
||Fri, 12 April 2013 21:47
| Cole Markham
Registered: July 2009
Location: College Station, TX
Unfortunately this is not possible. It's more complicated than just reconnecting to the UISession on the server. The UISession is tied to the HttpSession, so it will indeed stay around until the session times out (or the user reconnects when it will be cleaned up and a new one created). The problem is that there isn't currently a way to reconstruct the client browser state from the server representation. It should technically be possible, but I think it will require a significant effort. |
The best solution is to implement this functionality at the application level. There is some existing functionality for BrowserHistory and BrowserNavigation (see the Deep Links section) which could be leveraged in your application. For instance, you could use the BrowserHistory to push information about the open dialog which your application could then query on startup to restore the state. Also, see the Exit Confirmation support on that same page which allows you to prompt users when before they exit the application and accidentally lose information.
If you want to go one step further and save the information entered in the dialog/wizard, you can store that information on the server (by registering Modify/Focus listeners on the widgets). You could store that in the HttpSession (see User-specific data), but it may be lost if the browser crashes and doesn't reconnect to the same HttpSession. You could also use the ApplicationContext[also 2], a global singleton, an OSGi service, or similar mechanism to store the partially-entered data (you would need a userId or similar key, of course). This would naturally be quite a bit of work, so consider if your users really expect such behavior.
Hope that helps,
Powered by FUDForum
. Page generated in 0.02140 seconds