Book Image

Google Web Toolkit 2 Application Development Cookbook

By : Shamsuddin Ahammad
Book Image

Google Web Toolkit 2 Application Development Cookbook

By: Shamsuddin Ahammad

Overview of this book

GWT 2 radically improves web experience for users by using existing Java tools to build no-compromise AJAX for any modern browser. It provides a solid platform so that other great libraries can be built on top of GWT. Creating web applications efficiently and making them impressive, however, is not as easy as it sounds. Writing web applications for multiple browsers can be quite tasking. In addition, building, reusing, and maintaining large JavaScript code bases and AJAX components can be difficult. GWT 2 Application Development Cookbook eases these burdens by allowing developers to quickly build and maintain complex yet highly efficient JavaScript front-end applications in the Java programming language . It tells you how to make web experience all the more thrilling and hassle free, using various tools along with GWT SDK.This book starts with developing an application from scratch. Right from creating the layout of the home page to home page elements including left and right sidebars, to placing tree like navigational menu, menu bars, tool bars, banners, footers are discussed with examples. You will see how to create forms using the Ext GWT library widgets and handle different types of events. Then you will move on to see how to design a database for sales processing systems and learn to create the database in MySQL with the help of easy–to-follow recipes. One of the interesting topics of this book is using JPA in GWT. Using the JPA object in GWT is a challenge. To use them perfectly, a mechanism to convert the JPA object into plain object and vice versa is required. You will see recipes to use entity classes, entity managers, and controller classes in GWT application. You will efficiently create reports with parameters, variables and subreports, and get the report output in both HTML and PDF format using real-world recipes. You will then learn to configure the GlassFish server to deploy a GWT application with database. Finally, learn how to trace speed and improve perfomance in web applications using tracing techniques.
Table of Contents (16 chapters)
Google Web Toolkit 2 Application Development Cookbook
Credits
About the Author
About the Reviewers
Preface
Index

Creating a report


In this recipe, we are going to create a report that shows the list of sales.

How to do it...

  1. Go to File | New File….

  2. Select Report from Categories and Report Wizard from File Types.

  3. Click on Next.

  4. Select Simple Blue from Layout:

  5. Enter Sales.jrxml as the File Name, and type in Reports as the Folder:

  6. Click on Next.

  7. Click on the New button to create a new connection.

  8. Select NetBeans Database JDBC Connection as the datasource type:

  9. Enter Sales for Name and select jdbc:mysql://localhost:3306/Sales from the Connection list, as shown in the following screenshot:

  10. Click on Save.

  11. Click on Design Query.

  12. Double-click on the Employee, Sales, and Customer tables.

  13. Select SalesNo, SalesDate, and SalesDeskID from Sales; EmployeeId and Name from Employee; CustomerNo and Name from Customer:

  14. Click on OK.

  15. Click on Next and select all the fields:

  16. Click on Next, and then again click on Next without selecting any group.

  17. Click on Finish.

  18. Change the Title to Sales Invoice, remove the data from the Add a...