Data Model Flex


    
    xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"
    width="550">
     
         
        import mx.collections.XMLListCollection; 
        import mx.collections.ArrayCollection; 
        /* An XML object with categorized produce. */ 
        [Bindable] 
        public var myData:XML=   
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                

        /* An XMLListCollection representing the data for the shopping List. */ 
        [Bindable] 
        public var listDP:XMLListCollection = new XMLListCollection(new XMLList()); 
        /* 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()); 
            } 
        /* Remove the selected in the List from the XMLList data provider. */ 
        private function doListRemove():void { 
            if (prodList.selectedItem) 
                listDP.removeItemAt(prodList.selectedIndex); 
        } 
      
    

    
                    showRoot="false" labelField="@name" />
        
            
            
        

                    labelField="@name" />