PDA

View Full Version : [CLOSED] NullPointerException in BorderLayout.getRegionWidget()



andrey
17 Jun 2008, 11:14 AM
I'm getting the following with Beta5. Is anyone else getting this exception?

java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.widget.layout.(BorderLayout.java:256)
at com.extjs.gxt.ui.client.widget.layout.BorderLayout.onLayout(BorderLayout.java:123)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:68)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:252)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:343)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:235)
at com.extjs.gxt.ui.client.widget.Container.onAttach(Container.java:350)
at com.extjs.gxt.ui.client.widget.Viewport.onAttach(Viewport.java:73)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:231)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:119)From Eclipse, I can see that at line 256 of BorderLayout.java, w.el() is returning a null:

private BoxComponent getRegionWidget(LayoutRegion region) {
for (int i = 0; i < container.getItemCount(); i++) {
BoxComponent w = (BoxComponent) container.getItem(i);
if (w.getData() != null && w.getData() instanceof BorderLayoutData) {
BorderLayoutData data = (BorderLayoutData) w.getData();
if (data.getRegion() == region) {
w.el().makePositionable(true); // This is line 256
return w;
}
}
}
return null;
}The nature of my app is that I have a main panel with a BorderLayout(), and a ContentPanels in the WEST, NORTH, CENTER, and EAST regions. The EAST region is the region that the above exception is occurring in. If I comment out adding the EAST content panel, I don't get the exception. The funny thing is, the app was working before and I think the only thing I may have done was to collapse the EAST panel (it was setup to be collapsible). Could it be that there is some bug where the saved state is restoring a ContentPanel incorrectly if it was collapsed?

TIA,
Andre

darrellmeyer
18 Jun 2008, 3:40 PM
It looks like the component is not rendered, but that does not make sense. I looked over the code, and ran some tests, but could not see any problems. The layout worked fine with saving collapsed states.

If you are still having issues, can you put together some test code that shows your issue?

andrey
20 Jun 2008, 10:14 AM
Hi Darrell,

FYI : I haven't been able to reproduce it since I moved to RC1.

Thanks,
Andre