Data update bug in TreeGrid
In my program I have a TreeGrid which is connected with live data via a RpcProxy and a TreeLoader.
Now there's is a bug in the TreeGrid when the Parent 'Map' is open while there's a data update for this Parent 'Map'. For example in this situation 'Map A' when I make a copy of 'Doc A'. After the update of the data nothing seems to happen, but when 'Map A' is closed and opened again;
The old 'Doc A' and the new 'Copy of Doc A' are present in 'Map A' (as it should) but there's also a new strange copy of 'Doc A' outside 'Map A'
The new data outside the parent is random; sometimes only one file from the parent and sometimes multiple files from the parent. This behavior only occurs when the parent 'Map' is open while updating the data from this 'Map'. As a workaround my program closes every 'Map' before updating it's data. But this is a lot of work and is strange behavior to the user...
onDataChange does not trigger render/refresh methods
I've found the cause of the problem ~o)
Nothing happens after the data update because the GridView is not updated (onUpdate, doRender, renderUI, renderRows, refreshRow etc.) after a data update from the server... The onDataChange(M parent) from TreeGrid does not trigger any of these methods... :-?
Following on this, the methods from GridView are also not called when the parent branche (for example Map A) is closed after the data update. This causes the 'ghost Doc A' outside Map A after the data update and parent collapse;
There's no render/refresh so Doc A just stays where it already was, only the '-' from the parent Map A changes into '+'. This is actually the same situation as before;
Finaly Map A is expanded again, for the first time this triggers GridView methods;
insertRows(int firstRow, int lastRow, boolean isUpdate)
renderRows(int startRow, int endRow)
The rendering starts on the index of Map A and ends on the index of Copy of Doc A leaving the old 'ghost Doc A' untouched
There must be an additional function which renders the GridView straight after the data update onDataChange(M parent)
renderChildren only updates the nodes, not the store ...
The previous post shows the trace from replaceChildren(M parent, List<M> children) ;
... but it does appear to update the ListStore that represents the actual set of items to be rendered - this happens via the TreeGrid.renderChildren method. TreeGridView, which via GridView listens to that underlying ListStore should be listening to those events, should then respond through its own remove/add events. Any StoreDataUpdateEvent coming from the TreeStore should therefore be causing a bunch of add/remove events on the ListStore, which the GridView/TreeGridView should be reading, and redrawing accordingly.
replaceChildren(M parent, List<M> children)
register(M m) (only 'Copy of Doc A' is added to nodes)
Indeed, renderChildren(parent, autoLoad) is called with parent = 'Map A' and autoLoad = 'false'
As you can see, nothing happens to the store in this method ...
protected void renderChildren(M parent, boolean auto)
List<M> children = parent == null ? treeStore.getRootItems() : treeStore.getChildren(parent);
for (M child : children)
if (parent == null && children.size() > 0) // parent != null
for (M child : children)
if (autoExpand) // autoExpand == false
final M c = child;
public void execute()
else if (loader != null)
if (autoLoad) // autoLoad == false
if (store.isFiltered() || (!auto))