Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
Adobe Flex SDK 4.1 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce (with given example app):
1.click button labeled: "1) Delete 1.2"
2.click button labeled: "2) Add node to 1"
Actual Results:
When attempting to add the node, receive the following exception due to cursor not getting updated properly. The key to reproducing is that with setting it to selectedItem and removing it's children via removeAll.
Error: Unknown Property: '-1'.
at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:870]
at mx.controls.treeClasses::HierarchicalViewCursor/get current()[E:\dev\4.x\frameworks\projects\framework\src\mx\controls\treeClasses\HierarchicalViewCursor.as:212]
at mx.controls.treeClasses::HierarchicalViewCursor/collectionChangeHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\controls\treeClasses\HierarchicalViewCursor.as:869]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.controls.treeClasses::HierarchicalCollectionView/nestedCollectionChangeHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\controls\treeClasses\HierarchicalCollectionView.as:707]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.collections::ListCollectionView/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:1024]
at mx.collections::ListCollectionView/addItemsToView()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:1137]
at mx.collections::ListCollectionView/listChangeHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:1284]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.collections::ArrayList/internalDispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ArrayList.as:673]
at mx.collections::ArrayList/addItemAt()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ArrayList.as:394]
at mx.collections::ListCollectionView/addItemAt()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:596]
at mx.collections::ListCollectionView/addItem()[E:\dev\4.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:560]
at TreeTest/addItem()[/Users/xxx/_workspace/TreeTest/src/TreeTest.mxml:54]
at TreeTest/___TreeTest_Button2_click()[/Users/xxx/_workspace/TreeTest/src/TreeTest.mxml:74]
Expected Results:
Node added correctly
Workaround (if any):
When removing children from node, iterate through collection and use removeItemAt