-
3 Nov 2011 9:29 AM #1
[FNR] Bug in BorderLayoutContainer.setXXXWidget(Widget w)?
[FNR] Bug in BorderLayoutContainer.setXXXWidget(Widget w)?
I *think* I have encountered a bug. Or I'm doing something terribly wrong. This is with BorderLayoutContainer in GXT 3.0
When I have a BorderLayoutContainer, I can't necessarily set the widgets in the directional locations to any type of Widget.
This is the shortest bit of code I have that duplicates it:
The second line in the method throws a NullPointerException. (it is referred to as "Bug.java:17" in the exception trace provided below)PHP Code:public class Bug implements EntryPoint {
@Override
public void onModuleLoad() {
BorderLayoutContainer container = new BorderLayoutContainer();
container.setNorthWidget(new TextButton("Button"));
RootPanel.get().clear();
RootPanel.get().add(container);
}
}
I have only tried to do a setNorthWidget (or South, East, West) with Label, VerticalPanel, TextButton, and VerticalLayoutContainer.
With Label and VerticalPanel, it works fine. With TextButton and VerticalLayoutContainer, the exception is thrown.
Is it that it will only work with standard GWT Widget subclasses, and not GXT Widget subclasses?
The exception I get from the above code is as follows:
So, is it a bug, or am I using BorderLayoutContainer in some inappropriate way?Code:13:21:36.580 [ERROR] [bug] Unable to load module entry point class com.test.bug.client.Bug (see associated exception for details) java.lang.NullPointerException: null at com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.onInsert(BorderLayoutContainer.java:693) at com.sencha.gxt.widget.core.client.container.Container.insert(Container.java:380) at com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.setNorthWidget(BorderLayoutContainer.java:332) at com.test.bug.client.Bug.onModuleLoad(Bug.java:17) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:662)
(line 17 in Bug.java corresponds to the se
(PS: I used the PHP tags to show my Java code - is there some sort of java-specific tag that will allow better color coding of code snippets?)
-
3 Nov 2011 10:00 AM #2
This is fixed in SVN now.
You are not specifying any layoutData. Simple use a BorderLayoutData as a workaround for now.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote