Browser Refresh handling in GWT

2011-02-16 Thread Niraj Salot
Hi All, I would like to have below mentioned functionality in my application. = Once the user is logged in , If by mistake user presses the F5 OR refresh button , he should stay on the same page. Right now he is redirected to login page and all his session data are lost. I know about be

Re: Browser Refresh handling in GWT

2011-02-16 Thread buz...@gmail.com
Hi, I am aware of native (JSNI) approach doing this. Involves attaching unload listener to window. This triggers both on refresh or "hard" navigation to different url. public final class MyRefreshListener { public static void onUnload() { detachOnUnloadListener(); // Do your

Re: Browser Refresh handling in GWT

2011-02-16 Thread Thomas Broyer
Your issue seems to be that the user is signed-out (or not automatically signed-in, when loading the page). Given that you don't explain how login is handled (and also what you mean by "session data") in your app, I'm afraid it's impossible to help you further. -- You received this message be

Re: Browser Refresh handling in GWT

2011-02-16 Thread Niraj Salot
Hi, In My application , User is presented with Login page. Once his login is sucessful , He is transfered to another page (with History token mechanism). This is kind of main page of the application where he does all his work. On sucessful login , we are maintainng some user specific data in stati

Re: Browser Refresh handling in GWT

2011-02-16 Thread Sky
Niraj You're problem is two fold. As already mentioned you need to be auto logging the user back in when they refresh the page. Think about how any other ajax app works, including the newer version of google groups. I'm logged in and if I hit F5 I stay logged in. There has to be a session cookie

Re: Browser Refresh handling in GWT

2011-02-17 Thread Niraj Salot
To Make it more clear for everyone. If I Implement below mentioned code in my application. Window.addWindowClosingHandler(new Window.ClosingHandler() { @Override public void onWindowClosing(ClosingEvent event) { event.setM

Re: Browser Refresh handling in GWT

2011-02-17 Thread Sky
No, you always get the Confirmation dialog. Read my post carefully. I describe the correct way of doing this. You should NOT be preventing the user from leaving the page! They would not be able to go to your site and then decide to go to www.google.com, for example, in the same tab and this wil

Re: Browser Refresh handling in GWT

2011-02-22 Thread $ a r j i t h Pullithodi
Hi All, I donno whether I could understand the problem here completely. but I was also facing same kinda problem. and I was not using the History managment. but ever since i started using it, the problem solved. below is the code which keeps user on same page even if the user refresh the page. in

Re: Browser Refresh handling in GWT

2013-01-12 Thread JC
The * * *History.fireCurrentHistoryState(); * * * *works for me* * * *Thanks* * * *JC * On Tuesday, February 22, 2011 3:57:08 AM UTC-8, Sarjith wrote: > > Hi All, > > I donno whether I could understand the problem here completely. > but I was also facing same kinda problem. and I was not using th