2 Replies Latest reply on Jul 25, 2007 6:45 AM by JRusty15

    Tree leaf node as complex structure?

    JRusty15
      Ok, as many other users have posted, I'm new to Flex, but familiar with OOP. I am loading an XML file into an XMLListCollection with the e4x format. I use this as the dataprovider for a tree. Below is my xml data:


      <?xml version="1.0" encoding="utf-8"?>
      <forumList>
      <subject name="2G Discussion">
      <thread name="1995 vs 1997 body style">
      <post>
      <user id ="Turbotaloon95"></user>
      <input text = "I have a 1995 so I like it better than the 1997. Any other thoughts??"></input>
      </post>
      <post>
      <user id="JoeFakeName"></user>
      <input text ="Well I have a 1997 so mine's better. You suck. Eat poop!"></input>
      </post>
      </thread>
      <thread name="To 6 bolt swap or not to swap?">
      <post>
      <user id="JoeFakeName"></user>
      <input text ="I feel as though my stock motor is about to crankwalk. Should I do a swap or just keep the stock 7 bolt??"></input>
      </post>
      <post>
      <user id="Turbotaloon95"></user>
      <input text ="I'd go for the 6 bolt if you're going to build a new one."></input>
      </post>
      </thread>
      </subject>
      <subject name="Tech">
      <thread name="Low voltage?">
      <post>
      <user id="Turbotaloon95"></user>
      <input text ="After driving around for a few minutes, my volts drop to around 12.9 while driving. Anybody know why?"></input>
      </post>
      </thread>
      </subject>

      </forumList>

      granted this is difficult to read, but the root node is forumList with childNode subject, with childNode thread, with child node post. I want the tree to read the "thread" node as a leaf (aka. a doc icon, not an expandable folder), and have that node contain any and all "post" nodes that may be nested under it. More or less, this will be the data structure for an online forum I am attempting to create. I would like it so when the user clicks on the "thread" node in the tree, a custom component can populate any and all "post" nodes that are under it. I just don't want those post nodes to be displayed in the tree. I hope I have been clear in my question and I thank you in advance for your help.