View Full Version : [FIXED] NullPointerException when loading Table before render

26 Jun 2008, 1:52 AM
I use last SVN build.
I call loader.load(config) for a table which is not yet rendered. I get a load exception caused by a nullpointerexception :

Caused by: java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.widget.table.TableView.resize(TableView.java:381)
at com.extjs.gxt.ui.client.binder.TableBinder.onDataChanged(TableBinder.java:168)
at com.extjs.gxt.ui.client.binder.StoreBinder$1.storeDataChanged(StoreBinder.java:57)
at com.extjs.gxt.ui.client.store.StoreTypedListener.handleEvent(StoreTypedListener.java:35)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
at com.extjs.gxt.ui.client.store.ListStore.onLoad(ListStore.java:170)
at com.extjs.gxt.ui.client.store.ListStore$1.loaderLoad(ListStore.java:130)
at com.extjs.gxt.ui.client.data.LoadTypedListener.handleEvent(LoadTypedListener.java:34)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
at com.extjs.gxt.ui.client.data.BaseLoader.onLoadSuccess(BaseLoader.java:167)Maybe the TableBinder/TableView should resize only if the table is already rendered/not null ?

26 Jun 2008, 1:10 PM

26 Jun 2008, 10:11 PM
Actually, I was suggesting to test either table != null in TableView.resize() or table.isRendered() in TableBinder.onDataChanged() line 168. Maybe the second solution is nicer. Anyway, for now I still have the NullPointerException because you can the table.isRendered() test in TableView.resize() and table is null (it is initialized by the Table.onRender method).

If you want to know, the use case is I load a Table (loader.load(config)) which is in a TabPanel and the TabItem containing the Table has not yet been opened.

27 Jun 2008, 6:06 AM
Fix is in SVN.