0 Replies Latest reply on Oct 5, 2009 5:50 AM by tanushri goel

    To Represent XML data in tree form using flextreemap.

    tanushri goel Level 1

      How to represent the XML data in the form of flextreemap?

      I have created a simple flex treemap using the code below:::

       

      *************************************************************

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application

      xmlns:mx="

       

      http://www.adobe.com/2006/mxml

      "

      xmlns:toolbox="

       

      http://www.flextoolbox.com/2006/mxml

      "

      layout="

       

      vertical"

      >

       

       

       

      <!--

      Important Notes:

       

      1. Items use the labelField property to access @label from the XML to display.

       

      2. The TreeMap determines item renderer sizes by using the weightField property

      to access @data from the XML.

      -->

       

       

      <toolbox:TreeMap width="400" height="300

      "

      dataProvider="

       

      {MailBox}" labelField="@label" weightField="@data"

      />

       

       

       

      <!--

      Sample XML data to populate the TreeMap

      Source: "Working with Tree Controls"

      http://www.adobe.com/devnet/flex/quickstart/working_with_tree/

      -->

       

       

      <mx:XMLListCollection id="MailBox"

      >

       

       

      <mx:XMLList>

       

       

      <node label="Mail" data="100"

      >

       

       

      <node label="Inbox" data="70"

      />

       

       

       

      <node label="Personal Folder" data="10"

      >

       

       

      <node label="Business" data="2"

      />

       

       

      <node label="Demo" data="3"/>

       

       

      <node label="Saved Mail" data="5"

      />

       

       

      </node>

       

       

       

      <node label="Sent" data="15"

      />

       

       

      <node label="Trash" data="5"

      />

       

       

      </node>

       

       

      </mx:XMLList>

       

       

      </mx:XMLListCollection>

       

      **********************************************************************

       

      But which XML file i am using and where is that XML file , i have no idea...

      Please tell me how can i use an xml file to represent data in tree form as generated by the above code.

       

       

      Thanks & Regards,

      Tanuhsri Goel.