Community
Participate
Working Groups
Created attachment 134143 [details] Updated TreeItemUtil.js Environment: Firefox 3/Internet Explorer 7/RAP 1.2M6 Steps to reproduce: 1. Create a Tree widget (Note: not a TreeViewer) and populate with some TreeItems 2. Select one of the items 3. Remove the selected item and replace with another TreeItem Once this happens, selection is no longer posted to the server and getSelection returns an empty array even when items are selected in the browser. I have traced through the code and found the problem to be in the following file from org.eclipse.rap.rwt.q07_1.2.0.20090319-1159.jar: org/eclipse/swt/TreeItemUtil.js hijackTreeItemSelection should check if the TreeItem is disposed as follows: hijackTreeItemSelection : function( item ) { item._applySelected = function(value, old) { // Ensure item is not disposed if (this.isDisposed()) return; if (value) { this.addState("selected"); this._labelObject.addState("selected"); } else { this.removeState("selected"); this._labelObject.removeState("selected"); } ... etc
Vaughn, recently we fixed several bugs (bug 244952 and bug 266762) related to the tree widget. Can you check this issue against CVS HEAD. With CVS HEAD I can't reproduce what you described. If the bug persist please attach a snippet that demonstrate the bug.
Hi Ivan, As requested, I checked out the CVS HEAD code and ran against it. Unfortunately the problem still persists in my application (unless I make the code change I've previously attached). That said, I can't seem to be able to come up with a snippet that will reproduce the error. The actual code causing the problem is somewhat complex to post here as a snippet. I've tried to reproduce using the same elements my actual application code uses (background Jobs to update the tree, Display.asyncExec calls, Multiple listeners attached), but with no luck. With my application code, the bug is 100% reproducible, however, I have a fix so it is not a problem for me. Not sure if anyone else has seen this issue.
Without a snippet we can't do much about it. Please reopen it if you have a snippet to reproduce it.