Book Image

Google Web Toolkit GWT Java AJAX Programming

By : Prabhakar Chaganti
Book Image

Google Web Toolkit GWT Java AJAX Programming

By: Prabhakar Chaganti

Overview of this book

<p>GWT Ajax Programming shows you how to create reliable user interfaces that enhance the user experience.<br /><br />GWT is an open source Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who don't speak browser quirks as a second language. Writing dynamic web applications today is a tedious and error-prone process; you spend 90% of your time working around subtle incompatibilities between web browsers and platforms, and JavaScript's lack of modularity makes sharing, testing, and reusing AJAX components difficult and fragile.<br /><br />GWT lets you avoid many of these headaches while offering your users the same dynamic, standards-compliant experience. You write your front end in the Java programming language, and the GWT compiler converts your Java classes to browser-compliant JavaScript and HTML.</p> <h3>Chapter-by-Chapter</h3> <p><span style="font-weight: bold;">Chapter 1</span> introduces GWT, the download and installation of GWT, and running its sample application.</p> <p><span style="font-weight: bold;">Chapter 2</span> deals with the creation of a new GWT application from scratch, and using the Eclipse IDE with GWT projects, creating a new AJAX Random Quotes application, and running this new application.</p> <p><span style="font-weight: bold;">Chapter 3</span> deals with an introduction to and overview of GWT asynchronous services, and creating a prime number service and geocoder service.</p> <p><span style="font-weight: bold;">Chapter 4</span> deals with using GWT to build simple interactive user interfaces. The samples included in this chapter are live search, auto fillable forms, sortable tables, dynamic lists, and a flickr-style editable lable.</p> <p><span style="font-weight: bold;">Chapter 5</span> introduces some of the more advanced features of GWT to build more complex user interfaces. The samples included in this chapter are pageable tables, editable tree nodes, a simple log spy, sticky notes, and a jigsaw puzzle.</p> <p><span style="font-weight: bold;">Chapter 6</span> includes an introduction to JavaScript Native Interface (JSNI) and using it to wrap third-party JavaScript libraries like Moo.fx and Rico. it also includes using the gwt-widgets project and its support for the Script.aculo.us effects.</p> <p><span style="font-weight: bold;">Chapter 7</span> deals with creating custom GWT widgets. The samples included in this chapter are a calendar widget and a weather widget.</p> <p><span style="font-weight: bold;">Chapter 8</span> concerns itself with creating and running unit tests for GWT services and applications.</p> <p><span style="font-weight: bold;">Chapter 9</span> sees us using Internationalization (I18N) and client-side XML support in GWT.</p> <p><span style="font-weight: bold;">Chapter 10</span> includes the deployment of GWT applications using both Ant and Eclipse.</p>
Table of Contents (16 chapters)
Google Web Toolkit
Credits
About the Author
About the Reviewers
Preface
Running the Samples

Creating XML Documents


XML is in wide-spread use across enterprises in a variety of applications, and is also very commonly used when integrating disparate systems. In this section, we will learn about GWT's XML support and how to use it to create an XML document on the client side.

Time for Action—Creating an XML Document

We are going to take customer data stored in a CSV file, and create an XML document containing the customer data. The steps are as follows:

  1. 1. Create a simple CSV file with the customer data in a file named customers.csv in the com.packtpub.gwtbook.samples.public package. Add the information for two customers to this file:

John Doe,222 Peachtree St,Atlanta
Jane Doe,111 10th St,New York
  1. 2. Create the user interface in a new Java file named CreateXMLPanel.java in the package com.packtpub.gwtbook.samples.client.panels. Create a private HTMLPanel variable that will display the XML document that we are going to create. Also create a VerticalPanel class that will be the container...