How to get page state

44 views
Skip to first unread message

Deepak Singh

unread,
Mar 28, 2012, 12:19:28 PM3/28/12
to google-we...@googlegroups.com

Hi,

At some point of time, i have to reload the window (After login through Gmail authentication), so i want that the page should be loaded in the same state as it was before login.

how can i save the state of the entire page and come back to the same state after login ?

Thanks
Deepak Singh

Andy Stevko

unread,
Mar 28, 2012, 1:38:02 PM3/28/12
to google-we...@googlegroups.com
Using MVP places -
I try not to reload the browser window but rather redirect to a new Place + parameters (mypage.html#authreturnpage?x=y&a=b) with the same base URI. The browser takes in the url load as an event within the same application context so you don't loose state. Plus its easy to firewall to prevent url replay attacks.

You may still using the same trick without MVP. Not sure how it manifests within the app.



Deepak Singh

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
-- A. Stevko
===========
"If everything seems under control, you're just not going fast enough." M. Andretti





Deepak Singh

unread,
Mar 28, 2012, 4:23:08 PM3/28/12
to google-we...@googlegroups.com
I dont use MVP at all in my project. I use plain html with UIBinder and does hide and show with htmlpanels.

So whats the option for me in this case ?
Deepak Singh

Jens

unread,
Mar 28, 2012, 5:11:14 PM3/28/12
to google-we...@googlegroups.com
You don't have that many options if you have to reload your site:

- store your state in the URL if possible (GWT's Place feature can help you do so, you don't have to use MVP/Activities)
- store it using HTML 5 Web Storage (browser support: http://caniuse.com/#search=web storage)
- store it in cookies (only if you want to support IE6/7 and you can't store the state in the URL).

-- J.

Michael Allan

unread,
Mar 28, 2012, 9:25:20 PM3/28/12
to google-we...@googlegroups.com
Jens said:
> You don't have that many options if you have to reload your site:
>
> - store your state in the URL if possible (GWT's Place feature can help you
> do so, you don't have to use MVP/Activities)
> - store it using HTML 5 Web Storage (browser
> support: http://caniuse.com/#search=web storage)
> - store it in cookies (only if you want to support IE6/7 and you can't
> store the state in the URL).

Here's an example of both Web Storage and cookies for persisting
state: http://zelea.com/project/votorola/s/gwt/stage/Stage.java

It's running here. The black linkbar at the top uses it:
http://zelea.com/w/User:Frank-FlippityNet/Sys/p/sandbox

--
Michael Allan

Toronto, +1 416-699-9528
http://zelea.com/

dodo dard

unread,
Mar 29, 2012, 4:45:16 AM3/29/12
to google-we...@googlegroups.com
To add another tutorial website www.html5bydemo.com :)
You can find webstorage there
Reply all
Reply to author
Forward
0 new messages