PDA

View Full Version : Ext GWT 2.0: Beginner's Guide , chapter 2 does not work



mlotfi
14 Mar 2011, 6:40 PM
Hi,

I am new to Ext GWT, I bought this book :
Ext GWT 2.0: Beginner's Guide

When I got to chapter 2 page 39 Step 6 and I run the project It showed only a green page nothing on it.

Here is the code that I followed in the book :



public void onModuleLoad() {
Viewport viewport = new Viewport();
final BorderLayout borderLayout = new BorderLayout();

BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH,20);
northData.setCollapsible(false);
northData.setSplit(false);

HTML headerHtml = new HTML();
headerHtml.setHTML("<h1>RSS Reader</h1>");
viewport.add(headerHtml, northData);

BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setCollapsible(false);

BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200, 150, 300);
westData.setCollapsible(true);
westData.setSplit(true);

ContentPanel mainPanel = new ContentPanel();
ContentPanel navPanel = new ContentPanel();
viewport.add(mainPanel, centerData);
viewport.add(navPanel, westData);

viewport.setLayout(borderLayout);

RootPanel.get().add(viewport);

}



Please your help is appreciated.
thanks

micgala
15 Mar 2011, 2:50 AM
Hi.
This piece of code works fine.

Are you sure you added the references to gxt css file?
And you also added all other gxt resources (images and so on)?

Regards,
Michel.

mlotfi
15 Mar 2011, 5:36 AM
In the book the library used are :
GWT SDK-2.1.0
GXT_2_2_0

Mine is :
GWT SDK-2.2.0
GXT_2_2_3

I even copied the source code of the book (src and war)

I repeated the same steps in the book many times, the only thing I see in the browsers :

RSS Reader

Main

gishmo
15 Mar 2011, 7:38 AM
micgala ask, if you had copied the GXT Resources to your WebContent folder as described in the installation notes of GXT.

mlotfi
15 Mar 2011, 8:07 AM
Please I attched two pictures showing what I have in eclipse :

25147

25149

micgala
15 Mar 2011, 8:11 AM
From gxt seup.txt (available in the zip file download by you):


STEP 1 -> Create a Google Web Application Project project within Eclipse.

Copy the contents of the /resources folder in the download to a {foldername} location within your war folder.
Substitute {foldername} with the name of the folder you've created for resources within your war folder.

STEP 3 -> Add the following stylesheet to your host page.

<link rel="stylesheet" type="text/css" href="{foldername}/css/gxt-all.css" />

mlotfi
15 Mar 2011, 8:50 AM
Thanks lot for your helps, it works now.

If I can ask this question :
Why it's taking more than a min to show in the browser ?
thanks again.

micgala
16 Mar 2011, 12:35 AM
Unfortunatelly, the gwt development mode (debug) is kinda slow.
So, it takes some time for the application to load.

But in production mode, that does not happen.
So, I recommend that, unless you are really debugging something, you run your app in production mode.

Regards,
Michel.

mlotfi
16 Mar 2011, 5:07 AM
How to switch from development mode to production mode ?
thanks

micgala
16 Mar 2011, 5:13 AM
http://code.google.com/webtoolkit/gettingstarted.html