PacktLib: Google Web Toolkit 2 Application Development Cookbook

Google Web Toolkit 2 Application Development Cookbook


About the Author

About the Reviewers


Setting up the GWT Environment in NetBeans


Installing JDK

Installing GWT SDK

Installing GlassFish

Installing MySQL server

Configuring the MySQL Server

Installing NetBeans IDE

Adding the GlassFish server in NetBeans

Installing the GWT4NB plugin in NetBeans

Creating a GWT project in NetBeans

Adding Ext GWT

Creating Home Page with Panels and Menus


Creating the home page layout class

Adding the banner

Adding menus

Creating the left-hand sidebar

Creating the right-hand sidebar

Creating the main content panel

Creating the footer

Using the HomePage instance in EntryPoint

Forms with Layout and Widgets


Using widgets

Using TextField

Using a simple combo box

Using the radio button

Using DateField

Creating a simple form

Creating a form with two columns

Creating a TabPanel to show forms as tabs

Creating a navigation sidebar with Accordion layout

Handling your First Events


Handling ButtonEvent

Using the SelectionChange event

Handling FieldEvent

Working with the KeyUp event

Handling ChangeEvent

Working with MenuEvent

Using FocusEvent

Handling the DatePicker event

Creating Database for Sales Processing


Creating the database

Creating tables with primary key

Defining foreign keys

Backing up database

Restoring database

Managing Entities using JPA


Creating a database connection in NetBeans

Creating a persistence unit

Creating entity classes from the database

Creating controller classes

Communicating with the Server using GWT RPC


Creating DTO classes

Mapping entity classes and DTOs

Creating the GWT RPC Service

Defining an RPC method to persist objects

Calling the RPC method from Client UI

Finding an entity

Updating an entity

Deleting an entity

Managing a list for RPC

Authenticating a user through username and password

Reporting with iReport


Installing iReport plugins in NetBeans

Creating a report

Adding a parameter in a report

Adding a subreport

Adding a variable

Showing a report in the GWT application as HTML

Creating HTML report viewer

Calling HtmlReportViewer

Showing a report in a GWT application as PDF

Creating a PDF report viewer

Calling PdfReportViewer

Deploying a GWT Application


Building a project and creating the WAR file

Deploying on the GlassFish Server from NetBeans

Creating the JDBC Connection Pool in GlassFish

Creating a JDBC Resource in GlassFish Server

Deploying the WAR file in the GlassFish Server

Using Speed Tracer


Installing Speed Tracer

Running Speed Tracer

Analyzing event details

Analyzing network

Understanding hints