If pressing on your UI element should result in changing the visible screen content, then the event which triggers by the UI element (i.e. onClick) should simply add new item to the History stack and exit.
If you wonder where would be the code that actually changes the screen content, I will answer, "In the
HistoryListener#onHistoryChanged
method." And this method will be triggered as soon as the history item will be created. If you adhere to the above rule, you will get the following benefits:- You will provide the possibility to store bookmarks for specific state of your web-site
- You will not duplicate the logic that changes page content: all such code will go to the
onHistoryChanged
method
Links:
Introduction to the GWT History mechanism
http://www.linkedin.com/in/oldbam
No comments:
Post a Comment