If user accidentally presses F5 or the Fresh button after login, then it must remain on the same page. He has just returned to the login page.
I used the following code to stay on the same page.
But I would not like to warn the user on this situation by writing the event. OnWindowClosing () method setMessage () I just want to create the functionality that the user will feel that nothing has happened, even if it accidentally refreshes the browser.
I want to avoid unwanted pop-ups by [ or how to handle manually to prevent the occurrence of cancer popups, so that no one will be reloaded. . Com.google.gwt.user.client.Window.confirm ("Do you really want to get out?") ] But if you do not want to go under that road, the second solution provided by GWT Using the history system is done. There will be a special token in each of your application's "pages" (rather than the part). All you have to do is create a history change handler and present the appropriate items according to the token given by the user's reload operation. If you want some "memory" between the user's logout (but not the browser resume), then you can save this token in the local token and after the user logs in after directing it to the last page, use Which he was on.
window.addWindowClosingHandler (new window.ClosingHandler) {@Override public void onWindowClosing} {// How to stop the reload request or [manual on the cancel button]}}); Some comments above actions and places were mentioned as a solution to your problem
Comments
Post a Comment