Unable to execute a sample code

11 views
Skip to first unread message

Ravi M

unread,
Dec 10, 2007, 12:53:52 PM12/10/07
to Google Web Toolkit
Hello -

I am working on GwtExt sample codes (POC) so that I can use it in one
of my projects. I have written a GwtExtTest.java file which has code
as below :- (This code has been picked from GWT-EXT sample codes)

public class GwtExtTest implements EntryPoint
{
public void onModuleLoad()
{
LayoutDialog dialog = new LayoutDialog(new LayoutDialogConfig()
{
{
setTitle("Basic Dialog");
setModal(true);
setWidth(500);
setHeight(300);
setShadow(true);
setMinHeight(300);
setMinHeight(300);
}
}, new LayoutRegionConfig());

//first way to add button
Button saveBtn = dialog.addButton("Submit");
saveBtn.disable();

//another way to add button
dialog.addButton(new Button("Cancel", new ButtonConfig() {
{
setText("Cancel");
/*
setButtonListener(new ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
dialog.hide();
}
});
*/
}
}));

//add content to the center region
BorderLayout layout = dialog.getLayout();
ContentPanel contentPanel = new ContentPanel();
contentPanel.add(new HTML("<h1>Hello World!!</h1>"));
layout.add(contentPanel);

Button button = new Button("Hello World");
/*
button.addButtonListener(new ButtonListenerAdapter() {
public void onClick(Button button, EventObject e) {
dialog.show(button.getEl());
}
});
*/

}
}

For some reason, when I try to execute this code it gives me an error
message as below :-

[ERROR] Unable to load module entry point class
com.trc.client.GwtExtTest (see associated exception for details)
com.google.gwt.core.client.JavaScriptException: JavaScript TypeError
exception: '$wnd.Ext' is null or not an object
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
481)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:
270)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:
137)
at com.gwtext.client.core.Ext.setBlankImageUrl(Ext.java:190)
at com.gwtext.client.core.JsObject.<clinit>(JsObject.java:33)
at com.trc.client.GwtExtTest.onModuleLoad(GwtExtTest.java:26)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:342)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:
326)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access
$200(BrowserWidgetIE6.java:36)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:
70)

Can anyone help me with this problem.

Thanks.

shan muh

unread,
Jan 21, 2008, 3:18:41 PM1/21/08
to Google Web Toolkit
Hi,

You have to copy in the content of the public folder which comes with
GWT-EXT in the public forlder of your GWT project.
Refer to http://code.google.com/p/gwt-ext/wiki/GettingStarted

Best regards
Shan
Reply all
Reply to author
Forward
0 new messages