Saturday, August 29, 2009

GWT, A small notes

It seems that developing rich internet application using GWT is very interesting because of its rich of features widgets. But sometimes something annoying and unrealistic happens. Here are just small amount of problems that looks ridiculous and trivial but could give you headache and make you spend hours googling forums.

First thing first, consider this :

public class Skippy implements EntryPoint {
public void onModuleLoad() {

MenuView menu = new MenuView();

TicTacView tictac = new TicTacView();

RootPanel.get("menu").add(menu);

RootPanel.get("tictac").add(tictac);

}

}

Code snippet above is about to add two widgets to RootPanel. Look at this html code snippet :



See the connection? Yup I wanna add a widget in an appropriate html element. You can do this using this html code : <span id="menu"></span>, but not with this one : <span id="menu" />. A bit tricky huh...

Second thing is, folder structure. Suppose I wanna add some new classes in a package, say, LanguageConstants which is used for internationalization. You have to place it inside package that wraps your module (edu.mat.gwt.skippy) and if it is for client side then you have to place it inside client package, for example edu.mat.gwt.skippy.client.util. You can not put it inside edu.mat.gwt.skippy.util because the compiler will say that there is no source code for your class.

0 comments:

 

©2009 Stay the Same | by TNB