Ralf Sternberg <[EMAIL PROTECTED]> writes: > Hi Alex, > > Alex Back schrieb: >> your problem can be solved if you first deselect the item you want to >> remove. >> >> To explain the current behaviour: >> If you select an item after you removed the currently selected one, qooxdoo >> adds two jobs to the state queue: >> * remove the state "selected" from the current selected item >> * add the state "selected" to the newly selected item >> >> The problem is now that the item whose state "selected" should be removed >> not >> exists anymore. That's the point when the error-message pops up. So simply >> deselect the item before you remove it. That should do the job. > > Thanks for your answer. Deselecting helps for one error but I still get > two other ones with the same scenario, that is when a deselected item is > removed and another item is selected thereafter: > > qx.manager.selection.TreeFullControlSelectionManager[208]: Setting > property "leadItem" to "[object org.eclipse.rap.rwt.widgets.TreeItem]" > failed with exception: TypeError - this._states has no properties > > qx.manager.selection.TreeFullControlSelectionManager[208]: Setting > property "anchorItem" to "[object > org.eclipse.rap.rwt.widgets.TreeItem]" failed with exception: > TypeError - this._states has no properties > > Currently I remove the item using removeAt() on the TreeFolder that > contains the item and then dispose the item (which is also a TreeFolder). > > The errors does not occur if I don't dispose the items after removing them.
Ralf, would you please try the following. I don't have the time to test it right now, but on visual inspection it seems like this should work. If it works, I'll add it to the distribution... In the file frontend/framework/source/class/qx/ui/tree/AbstractTreeElement.js find the method destroy(). You'll see that the destroy method immediately follows the getLabelObject() method. Copy that entire destroy() method and insert it into to the matching file in the treevirtual subdirectory frontend/framework/source/class/qx/ui/treevirtual/AbstractTreeElement.js You can place it, as in the other file, immediately following the getLabelObject() method. In your application, call the destroy() method instead of the sequence of commands you have there currently to remove an item from the tree. Please let me know if that destroy() method, stolen from tree and inserted into treevirtual, works as desired. Thanks, Derrell ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel