wcx6298 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

ListGrid selection changed/update handler error #723

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello.

I have created ListGrid instance and added addSelectionUpdatedHandler, 
addDataChangedHandler and addSelectionChangedHandler to it. Handlers 
successfully work until record filtering is involved.
I expect that, when filter is performed and selection is lost from the grid, 
selection change handler execute and contain reference to zero selected records 
(as reference from grid or event). In reality no selection changed/update 
handlers are invoked and on data changed handler grid still has reference to 
old selection.

Test case (see attachment files with sources and data).
1. Select one of the record. (handlers works fine)
2. Use column filter that selected records are filtered out. Handlers do not 
execute and I'm not notified that selection is changed.

Additional data.
1. I'm using SmartGWT v. 4.0 standard edition, also tested in 4.0p and 4.1p.
2. Tested in Chrome latest version (Version 26.0.1410.63)
3. Problem occurs at the client side.

Original issue reported on code.google.com by romans.g...@gmail.com on 6 Sep 2013 at 9:54

Attachments:

GoogleCodeExporter commented 9 years ago
Whether or not this really drops the selection depends on ResultSet caching 
behavior.

Regardless of whether the selected record is dropped from the cache, we think 
most uses of the selectionChanged handler would *not* want to take action in 
this circumstance (such as - clearing a form that is populated with the current 
selected record), so we will not be changing this behavior.

If you need to detect this situation in your app, you can use DataChanged and 
findRecord() to see if the selected record is still visible.

Original comment by smartgwt...@gmail.com on 6 Sep 2013 at 7:50