简体   繁体   中英

Flex xml in tree

The following xml values is getting from php file

<result>
   <list>
      <node>air</node>
      <node>flex</node>
      <node>android</node>
   </list>
</result>

i am calling this xml using httpservice

 <mx:HTTPService 
        id="project" 
        url="http://localhost/eshpm/AIR/newproject.php"
        method="POST" result="onResult_projectname(event)" resultFormat="e4x">
            <mx:request xmlns="">
                <name>yes</name>
            </mx:request>
</mx:HTTPService>

The result is obtained using the function

private function onResult_projectname(evt:ResultEvent):void
 {

        xmldata = new XML(evt.result);
        xmlList_user = new XMLListCollection(xmldata.list);             

        tree.dataProvider = xmlList_user.children();            
 }

The problem is that i am able to display the values in Tree.......but it is repeating

ie, "air" is comming in tree twice....

plz help.............thanks

Try using <mx:Tree dataProvider="{project.lastResult.result}" labelField="node"/> . By invoking project.send() databinding works and populates your Tree.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM