View Full Version : [FIXED] 0.5.x RowSelection model bug and patch

22 Apr 2008, 4:11 AM
Since net.mygwt.ui.client.viewer.TableViewer#setSelection(ISelection, boolean) uses fairly ineffective approach and selects/deselects every item in a table, there is enormous amounts of SelectionChange events fired even for simple cases.
For instance, if none is selected and I call setSelection(new DefaultSelection()) on a table with 100 rows, 100 SelectionChange events will be generated.

One possible way to fix is in attached patch.
It also fixes a little problem with render listener.

22 Apr 2008, 9:39 AM
The Table and TableViewer selection code need to be refactored which I am doing now. Changes will go out in the next rev.

23 Apr 2008, 1:43 AM
Will in include fix for vertical lines? (i have my fingers crossed)

23 Apr 2008, 1:56 AM
One more thing.

Consider following scenarion:

1. I have a list with 10 elements.
2. I'm programmatically selecting 10 of them at once.
3. I'm getting 10 SelectionChange events.

I'd like to have only one event in this case. Same for deselecting, of course. Also adding/removing.

23 Apr 2008, 5:46 AM
Yes, this is part of the reason I am changing the code.

29 Apr 2008, 7:57 PM
This is fixed in beta2. Please validate.

29 Apr 2008, 11:29 PM
thx, but I'm not able to validate anything 1.x related