Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Google Web Toolkit: AJAX Buzz Meets Real World Development : Page 5

With its Swing-like development framework and its awe-inspiring compiler/debugger, the Google Web Toolkit eases AJAX development.


advertisement

A Well Earned Respect for History

One of the major peeves of using AJAX-based applications is that they tend to lose functionality provided by the browser back button. With GWT, history gets its respect. GWT provides a hook for your application to respond as it pleases to browser back and forward events.

The following listing of HelloHistory.java shows a HelloHistory composite widget implementing GWT's HistoryListener interface:

package com.techyatra.awe.client; ... public class HelloHistory extends Composite implements HistoryListener { public HelloHistory() { ... History.newItem(textHistory.getText()); ... History.addHistoryListener(this); } public void onHistoryChanged(String historyToken) { String token = History.getToken(); if (token != null) { textHistory.setText(token); } } }



When users of your application press back and forward buttons on their browsers, you get a chance to respond to it in the onHistoryChanged() method. You track history with tokens; you add tokens to the history as you see fit; and then you rely on these tokens to perform appropriate processing in the onHistoryChanged() function.

A New Application Platform?

What Google has done with GWT is provided the power to develop Web-based, fat client-caliber applications that don't rely on the ubiquitous Windows operating system. An opening salvo for platform turf, perhaps?



Gautam Shah has been developing large, complex applications for over a decade, including solutions that enable information sharing between government entities. He has varied expertise in J2EE, .NET, open source solutions, and various integration platforms such as BizTalk, WebMethods, and WebSphere Business Integration Server.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap