martes, 4 de diciembre de 2012


This time I will describe a CRUD application using GXT Grid and HttpProxy on the client side and on the server side I use PHP and PDO to access a PostgreSQL database.
The communication between client and server side is using JSON then you can use whatever language on the server side that produce a JSON output.
The source code is on github is structured using GWTP and GWT Editor for binding.

Database table

GXT and HttpProxy
First of all the next interfaz and class are required

GWT AutoBean
With GWT AutoBean is easy to serialize/deserialize GWT Objects to json and vice versa,
on the client side there is the UserProxy interface that represents the model

UserListProxy represent a set of users

With AutoBean the objects are created from a factory

GXT Reader
GXT Grid use a reader to parse the output of the server.

GXT Grid


Run the proyect
You have to start your Apache Server and enable the following extensions for PostgreSQL and PDO:
You have to set the root of your web server to the war of the project
for example I use XAMPP and change the httpd.conf
restart Apache Server.
Set the parameters of connection to database PostgreSQL in war/config/connect.php
I usually work on Firefox for GWT DevMode

Compile GWT code to JS
I compile GWT with Google Plugin for Eclipse GPE

By default the compiled JS code is compressed.

Then enter the url http://localhost/phpcrud.html#users

The Server Side PHP
I use simple PHP and PDO
Sorry if I am missing explain PHP code.

I hope you can use GWT with any backend and AutoBean is a nice feature of  GWT.

2 comentarios:

  1. Hi,

    I tried to run your example but I have an exception in "createRequestFilterConfig", "original" is null.

    Do you have an idea ?



  2. Could you be more specific.
    I use Eclipse Juno
    I downloaded and imported the eclipse project using Egit.
    I have the GPE(Google plugin for eclipse) only for GWT
    I have a GWT 2.5 as SDK.
    And tested with firefox in dev mode with the Google Developer Plugin and is OK.
    Maybe you need configure the eclipse project.