PDA

View Full Version : [1.1] Table.getSelectedItem behaviour changed



villemustonen
17 Sep 2008, 11:01 PM
In 1.0.4 i had a TableListener listening to clicks on table rows. Whenever something was clicked, the clicked row was selected and some data from its Model was passed to another window. After upgrading to 1.1, when I click the row I get a NullPointerException. It is caught in the row


Model m = ((MediaObjectModel) searchWindow.getSearchResults().getSelectedItem().getModel());

In the above code, it is the getModel()-method that throws the NPE, and getSearchResults returns the Table.

The full stacktrace (if it is of any use)



[ERROR] Uncaught exception escaped
java.lang.NullPointerException: null
at fi.jutel.rmweb.client.search.controller.SearchController$6.tableCellClick(SearchController.java:417)
at com.extjs.gxt.ui.client.event.TableListener.handleEvent(TableListener.java:20)
at com.extjs.gxt.ui.client.event.TableListener.handleEvent(TableListener.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:423)
at com.extjs.gxt.ui.client.widget.table.TableItem.onClick(TableItem.java:192)
at com.extjs.gxt.ui.client.widget.table.TableItem.onComponentEvent(TableItem.java:76)
at com.extjs.gxt.ui.client.widget.table.Table.onComponentEvent(Table.java:441)
at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:655)
at com.extjs.gxt.ui.client.widget.table.Table.onBrowserEvent(Table.java:423)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1287)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1255)
at sun.reflect.GeneratedMethodAccessor157.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
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:720)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)

darrellmeyer
18 Sep 2008, 8:33 PM
Please post some sample code that illustrates your problem.