tags:

views:

27

answers:

1

Hi,

Let's say I have a gwt application with many widgets and I've used them many times such that some dialog windows are opened, some radio buttons are checked, etc.. Then, I go to another website and click back button but I see that the previous view is lost. What are the ways to restore it? One remark: If it is connected with gwt history mechanism I don't want to register every action in it.

Thanks in advance

+1  A: 

Well, History is the recommended way handling such situations. Since you can't refresh the page, you can't pass data via POST.
One solution that comes to my mind is storing information in the window.name variable. It's a "forgotten" variable, that doesn't have a limit on its contents (IIRC) and doesn't get cleaned when you go to another website. You'd probably have to write some JSNI code, here are some links on this topic: link1, link2, Google for more ;)
But you'd be doing the same thing for History - the only difference is that the user won't see a possibly long URL. But do you really need to remember all those values? It's understandable for moving between views inside an app, but when the user moves away from the site and comes back, he/she's not expecting to see the values remembered (and it might be confusing and a possible security hole).

Igor Klimer