Browse DevX
Sign up for e-mail newsletters from DevX


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.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

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.
Thanks for your registration, follow us on our social networks to keep up-to-date