If you run the code below, click the button, and expand the "asdf" node, you'll see an unexpected node caused by <mx_internal_uid>[some hash code here]</mx_internal_uid> that gets added to the xml.  Here's the resulting xml:

<items>
  <item label="tom"/>
  <item label="asdf">
    <item label="efefe"/>
    <mx_internal_uid>E4A7C73B-1295-31E9-6978-E772A0407B7F</mx_internal_uid>
  </item>
</items>

and the sample code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application creationComplete="init()" xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.collections.XMLListCollection;
           
            private var myXML:XML = <items><item label="tom"/></items>;
           
            [Bindable]
            private var xmllc:XMLListCollection;
           
            private function init():void
            {
                xmllc = new XMLListCollection( new XMLList( myXML.item ) );
            }
           
            private function addNode():void
            {
                var foo:XMLList = new XMLList( <item label="asdf"><item label="efefe"/></item> );
               
                xmllc.addItem( foo );
                trace( myXML );
            }
        ]]>
    </mx:Script>
    <mx:VBox>
        <mx:Tree width="200" id="myTree" dataProvider="{xmllc}" labelField="@label"/>
        <mx:Button click="addNode()" label="click"/>
    </mx:VBox>

</mx:Application>
__._,_.___

--
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




__,_._,___

Reply via email to