navigating from one HTML page to another

87 views
Skip to first unread message

mrfreeze81

unread,
Apr 3, 2009, 11:56:33 PM4/3/09
to Google Web Toolkit
I want to navigate from one HTML page to another (P1.html to P2.html).
On start up my code loads P1.html as entrypoint. I have a few buttons
there as navigation buttons. One of the buttons when clicked should
take me to p2.html.

I have to load a new page (that's my requirement) but do not want to
refresh or clean my Rootpanel and add a new widget. I also want to
retain my session when I move from p1.html to p2.html.

How do I go about this,.

Thanks in advance

Ian Bambury

unread,
Apr 4, 2009, 12:33:27 AM4/4/09
to Google-We...@googlegroups.com
Why do you want to do it like this? It's a very strange requirement for an Ajax-based site, and not wanting to remove and add widgets means that you will get very little (if any) benefit from using GWT.

If that is really what you want to do, I'd suggest looking at some other languages.

Ian

http://examples.roughian.com


2009/4/4 mrfreeze81 <mrfre...@gmail.com>

Vitali Lovich

unread,
Apr 4, 2009, 5:45:31 AM4/4/09
to Google-We...@googlegroups.com
Not only that, but you may want to brush up on what Javascript is.
Just because you write GWT code in Java, it's still Javascript in the
end. If you figure out a way to maintain session state purely on the
client-side (especially through Javascript only) between pages I'd
like to hear about it. Cause that would be a huge security & privacy
flaw in the browser.

One hack, that may or may not work, would be to have p1 & p2 include
p3.html as an iframe. P3 then maintains "state" through cookies which
hopefully haven't been cleared in the transition.

The other, proper way, would be to have p3 (your actual app) load p1
in an iframe. then when a request is made, load p2. However, you're
going to have XSS issues - AFAIK, this kind of stuff of scripts
communicating between different pages is an HTML5 "feature".
Reply all
Reply to author
Forward
0 new messages