2 Replies Latest reply on Jun 26, 2007 7:31 AM by dennismr

    Creating a tree control

    dennismr
      I'm trying to dynamically create a tree control from a comma delimited string that I have returned to me from a database query. Here's the code I'm using to create and populate the control. The complete string is populating only one node of the tree. Any ideas or suggestions would be really appreciated...Thank you.

      <mx:Script>
      <![CDATA[
      default xml namespace = " http://www.swst.com"; //necessary to access the xml elements easily
      import mx.rpc.events.ResultEvent;
      import mx.collections.ArrayCollection;
      import mx.collections.ICollectionView;
      [Bindable]
      public var collection:ICollectionView;
      private var _xmlResult:XML; //holds the result xml

      private function onResult(oEvent:ResultEvent):void
      {
      _xmlResult = XML(oEvent.result);
      collection = new ArrayCollection([xmlResult.getFoldersResult[0]]);
      }
      ]]>
      </mx:Script>