Tuesday, December 17, 2013

Re: SingleSelectionModel with KeyProvider does not update selected object when data is refreshed

Hi Gordan,

Ah great, then I was not alone having this issue. Problem was that we are using a highly customized layer on top of the DataGrid so I was not entire sure that it was caused by my team additions or not.

David


On Tue, Dec 17, 2013 at 8:13 PM, Gordan Krešić <gordan.kresic@steatoda.com> wrote:
I just hit the same issue.

Tripple checked that DataGrid, ListDataProvider and SingleSelectionModel all use the same KeyProvider (that itself uses stableId() from contained EntityProxies).

Updates are pushed via ListDataProvider.getList().set(int, T) and they are shown in table with selection preserved.

Still, SingleSelectionModel.getSelectedObject() (called in separate (later) event, just to eliminate missed flush()-es from ListDataProvider) returns old object as it were before update.

On Friday, December 6, 2013 3:35:46 PM UTC+1, stuckagain wrote:
Hi,

I noticed an issue in the SingleSelectionModel when used in combination with a KeyProvider and updating the cell table with new data.

The idea is that I want to retain selection, and that seems to work. What does not work is when I use the getSelectedObject method I get an older version of the object instead of the refreshed version.
Is that the way it is supposed to work ? Wouldn't it be smarter to recalculate selection when the data in the table is updated ?

I currently implemented a workaround that uses the KeyProvider to find the item in the table that has the same key as the previous selection.

David

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment