PDA

View Full Version : GXT 4.0.1 - TreeSelectionModel - double SelectionChangedEvent fires



Cloudgatherer
13 Sep 2016, 1:24 PM
Fairly similar if not same issue as:
https://www.sencha.com/forum/showthread.php?310127
That bug seems to NOT occur in GXT 3.0.6 or earlier, so this seems to affect at least GXT 3.1.X thru GXT 4.0.X.

First firing: TreeSelectionModel::OnMouseClick(NativeEvent event) (see line 251 in GXT 4.0.1)
Second: TreeSelectionModel::OnMouseClick(NativeEvent event) (see line 273in GXT 4.0.1) <-- this eventually calls into AbstractStoreSelectionModel::doMultiSelect(...) and fires a change event only on a change at line 417 of that class.

Fix seems to be needed in the TreeSelectionModel itself. I'm disappointed that this event is even firing on a MouseClick, it really seems like it should be a different event.

My workaround is as follows:

theTree.setSelectionModel(new TreeSelectionModel<Event>() {
protected void onMouseClick(NativeEvent event) {
fireSelectionChangeOnClick = false;
super.onMouseClick(event);
}
});

Cheers.