gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 374 forks source link

CellTree does not update when the data provider is updated with a list containing the same number of root elements #6978

Closed dankurka closed 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 6979

Found in GWT Release (e.g. 2.4.0, 2.5.0 RC):

GWT 2.4.0

Encountered on OS / Browser (e.g. WinXP, IE8-9, FF7):

Chrome

Detailed description (please be as specific as possible):

When a CellTree list data provider is updated with new data, the tree does not update
the view unless the number of elements in the root level of the tree changes.  In a
previous version of GWT the list would refresh if dataProvider.setList() was utilized
to replace the list with new content.  Calling listDataProvider.refresh() does not
help.

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

Call listDataProvider.setList() with a list.  Change the list contents but do not change
the number of elements.  When calling setList() again the list will not change or update.

Workaround if you have one:

My workaround was to call getList() on the list data provider  and compare the number
of existing elements to the new list.  If the number of elements was the same, I added
a fake element to the end of the list that would render as a blank entry.  If the number
of elements was different then I did not adjust the list at all.

Links to relevant GWT Developer Forum posts:

A somewhat related problem is http://code.google.com/p/google-web-toolkit/issues/detail?id=6451
where the list refuses to ever refresh if you set the list to an empty list (no elements).

Reported by glenne@engel.org on 2011-11-11 17:53:00

dankurka commented 9 years ago

Reported by rdayal@google.com on 2011-11-11 21:37:08

dankurka commented 9 years ago
I have a same problem!how can fix the issue?
http://stackoverflow.com/questions/9246780/how-to-update-root-node-using-gwt-celltree#comment11658614_9246780

Reported by tom.tan.china on 2012-02-13 00:57:26

dankurka commented 9 years ago

Reported by dankurka@google.com on 2013-06-03 12:46:23