2 Replies Latest reply on Aug 29, 2007 12:28 PM by fcu

    Need Explanation of HTTPService and Tree Control

    drjfreeze
      Can someone clarify for me the best way to request data for
      a tree control. I have seen several combinations of using
      a dataProvider that is typed as either a ICollectionView,
      XMLListCollection of ArrayCollection.

      In all cases the data being returned by the HTTPService call
      is XML, so I'm not sure of the reasons why there are so
      many ways to do this.

      Two examples of these styles are shown below.

      <mx:Script>
      <![CDATA[
      [Bindable]
      private var treeDP:ICollectionView;
      private function treeRPCResult(event:ResultEvent):void {
      projectsDP = event.result.repeated_data;
      }
      ]]>
      </mx:Script>

      <mx:HTTPService id="projectsSvc"
      url=" http://{HOST}:{PORT}/tree_data.xml" method="GET"
      result="treeRPCResult(event)"
      fault="showFault(event)">



      --- OR ----

      <mx:Script>
      <![CDATA[
      [Bindable]
      private var treeDP:XMLListCollection;
      private function treeRPCResult(event:ResultEvent):void {
      projectsDP = new XMLListCollection(event.result.repeated_data);
      }
      ]]>
      </mx:Script>

      <mx:HTTPService id="projectsSvc"
      url=" http://{HOST}:{PORT}/tree_data.xml" method="GET"
      resultFormat="e4x"
      result="treeRPCResult(event)"
      fault="showFault(event)">


      Thanks

      Jim