PDA

View Full Version : [FNR][1.2.2] Non-rendered TreeTable null pointer on store.update()



Cputerace
13 Apr 2009, 6:49 AM
I have so far been unable to put together a simple code sample that reproduces this, however it happens in my code. There is a defect in the TreeTableView class. The following stack trace occurs for a null pointer when I call store.update on an item in a tree that has not yet been rendered (in my case it is in a tab that has not yet been shown):

(note the line numbers match to 1.2.2 code, as we have not gone to 1.2.3 due to the viewport issue).
com.extjs.gxt.ui.client.widget.treetable.TreeTableView.renderItemValue(TreeTableView.java:225)
com.extjs.gxt.ui.client.widget.treetable.TreeTableItem.setValue(TreeTableItem.java:302)
com.extjs.gxt.ui.client.binder.TreeTableBinder.updateItemValues(TreeTableBinder.java:172)
com.extjs.gxt.ui.client.binder.TreeTableBinder.update(TreeTableBinder.java:115)
com.extjs.gxt.ui.client.binder.TreeBinder.onUpdate(TreeBinder.java:437)
com.extjs.gxt.ui.client.binder.StoreBinder$1.storeUpdate(StoreBinder.java:74)
com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:42)
com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:1)
com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
com.extjs.gxt.ui.client.store.Store.update(Store.java:502)

What i have found is the following:
On TreeTableView.java:225:
String s = treeTable.getRenderedValue(item, index, value);
treeTable is null.

This is because TreeTableView.init(TreeTable) has not yet been called.
It has not been called because TreeTableView.init() is called in TreeTable.onRender(), which has not happened yet.

Cputerace
15 Apr 2009, 7:17 AM
Any update on this? This seems like a major issue in the code, and it is currently throwing exceptions regularly in our app...

Cputerace
30 Apr 2009, 5:00 AM
Ok i have done some more digging on this issue, and it seems that somehow the TreeTableItem is thinking it is rendered, even though the tree it is in is not rendered.

in TreeTableItem.setValue()
rendered is true, so the
if (rendered)
treeTable.getView().renderItemValue(this, index, value);
calls even though getView is not rendered.

I am trying to figure out how TreeTableItem is getting "rendered", anyone have any ideas what may cause it to become "rendered"?

darrellmeyer
30 Apr 2009, 8:53 PM
Fixed in SVN.