PDA

View Full Version : [CLOSED] Tree setSelectedItemBug



alawi
31 Aug 2008, 7:45 PM
Hello guys,

//lc is a tree item
this.expandPath(lc.getPath());
this.setSelectedItem(lc);

In the above code, if I remove the expandPath line I will get the following error:


java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.widget.tree.Tree.onSelectChange(Tree.java:444)
at com.extjs.gxt.ui.client.widget.tree.Tree.onSelectChange(Tree.java:1)
at com.extjs.gxt.ui.client.widget.selection.AbstractSelectionModel.doSelectChange(AbstractSelectionModel.java:353)
at com.extjs.gxt.ui.client.widget.selection.AbstractSelectionModel.onRender(AbstractSelectionModel.java:476)
at com.extjs.gxt.ui.client.widget.selection.AbstractSelectionModel$2.handleEvent(AbstractSelectionModel.java:386)
at com.extjs.gxt.ui.client.widget.selection.AbstractSelectionModel$2.handleEvent(AbstractSelectionModel.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:420)
at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:405)
at com.extjs.gxt.ui.client.widget.Component.render(Component.java:849)
at com.extjs.gxt.ui.client.widget.Layout.renderComponent(Layout.java:182)
at com.extjs.gxt.ui.client.widget.layout.FlowLayout.renderComponent(FlowLayout.java:109)
at com.extjs.gxt.ui.client.widget.Layout.renderAll(Layout.java:173)
at com.extjs.gxt.ui.client.widget.Layout.onLayout(Layout.java:165)
at com.extjs.gxt.ui.client.widget.layout.FlowLayout.onLayout(FlowLayout.java:101)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:69)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:251)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:338)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:236)
at com.extjs.gxt.ui.client.widget.Container.onAttach(Container.java:345)
at com.extjs.gxt.ui.client.widget.ComponentHelper.doAttach(ComponentHelper.java:20)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:255)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:338)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:236)
at com.extjs.gxt.ui.client.widget.Container.onAttach(Container.java:345)
at com.extjs.gxt.ui.client.widget.ComponentHelper.doAttach(ComponentHelper.java:20)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:255)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:338)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:236)
at com.extjs.gxt.ui.client.widget.Container.onAttach(Container.java:345)
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)
at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:86)
at com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:80)
at dahra.client.DahraEntry.showMainPanel(DahraEntry.java:103)
at dahra.client.DahraEntry.onModuleLoad(DahraEntry.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:320)
at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:324)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$200(BrowserWidgetIE6.java:37)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:71)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:128)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:721)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:594)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:358)



Alawi

darrellmeyer
3 Sep 2008, 7:29 PM
Please take a look at the posting guidelines (http://extjs.com/forum/showthread.php?t=40289), and post again including some executable test code.

alawi
3 Sep 2008, 8:08 PM
My apology darrel,

It seems that the problem is fixed in gxt-1.1-alpha4 as I was not able to replicate it while creating the sample test code (or maybe I was wrong about the problem :">).

I totally understand where you are coming from, and I promise to follow the guidelines in the future posts.

Regards,
Alawi