Any one tried this example?
 
Flex 2 Developer's Guide > Building User Interfaces for
Flex Applications > Using Data Providers and Collections > Using hierarchical data providers > Using an XML data provider
 
 
 
"Using the XMLListCollection class" example has a serious problem, when you delete an item in the List, if it is a leaf node in the Tree it gets deleted too
 
This is happening because of cross references that exist  (we are directly adding the node to List which still has references to myData, the tree dataProvider)
 
Solution to this problem is simple, we need to make a copy to add to the list, then everything will be all right
 
we just need to change the doTreeSelect function as follows
 
        // Add the item selected in the Tree to the List XMLList data provider.
        private function doTreeSelect():void
        {
            if (prodTree.selectedItem)
                listDP.addItem(prodTree.selectedItem.copy());
        }

 
I've attached the bug fixed MXML as well
 
Regards,
Arul
 
Adobe Community Expert
 
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Attachment: XMLListCollectionExample.mxml
Description: Binary data

Reply via email to