You likely wouldn't be able to tell the difference between the back/ forward button being used. The history change event could just as likely have been triggered from a bookmark or copy/paste of the URL. Also, you'd have to handle cases wher the user navigates back or forward more than one page at a time.
I can think of two alternatives. 1. Put a unique token on the URL for every change to the model and store the state of the model associated with that token. 2. Instead of using the back/forward buttons, put your own undo/redo buttons on your UI. If it were me, I'd go with the second option. I feel that the back/ forward buttons are better for managing view state than application data state. -Brian On Oct 17, 7:17 am, jorge <[email protected]> wrote: > Hi, > > In my application, I need a behaviour similar to the undo-redo of > desktop applications instead of normal web pages history behaviour. > I'll explain what I need with an example scenario: > > 1 - The user creates an element. > 2 - The user realizes that he made a mistake. > 3 - He pushes the back button. > At this point I need to delete the element from my application and > from the page and leave everything as it was before. > > After the onValueChange method is invoked, I store the history token > as previous token for that, but I only need to use the previous token > if the back button is pushed and not in any other case. > > So my question is: > > Is it possible to identify it the source of the event is originated by > the back, or forward button? because depending on that, the behaviour > of my history should be different. > > Thanks and regards, > > Jorge --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
