Section 8.14. Finally, The Back Button


8.14. Finally, The Back Button

The GWT provides a way to restore the functionality of the web browser's back button in an Ajax application. Typically, the state of a single-page Ajax application is not related to the browser's back button.

NOTE

A single-page application is the software version of a one-act play. Since dynamic JavaScript can create web page widgets and change appearances on the fly, the web page, in terms of the physical file that the browser loads from the server, remains the same. The user can log in, manipulate buttons, lists, text fields, and other form elements, and the screen changes accordingly. The XMLHttpRequest object can exchange data invisibly with remote components, but the browser never has to fetch different web page files from the server. The state of the application does change, however, as stored in JavaScript objects and arrays.

In other words, the user changes something in the Ajax application by, say, clicking a button or making a selection-list choice, and he cannot go back to the application's previous state by clicking the browser back button. All he can do is reload the web page and thereby restore the page's initial state.

This is because the Ajax application's state is not associated with a URL in the browser's history list, as it is with conventional web browsing. In the conventional manner, if you surf from the New York Times home page to another web page, for example, the back button will bring the user back to the newspaper's home page. This is not true with the various states of an Ajax application, unless you use GWT's mechanism, which this shortcut introduces for you.




Google Web Toolkit for Ajax
Google Web Toolkit GWT Java AJAX Programming: A step-by-step to Google Web Toolkit for creating Ajax applications fast
ISBN: 1847191002
EAN: 2147483647
Year: 2006
Pages: 29

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net