1 Reply Latest reply on Apr 12, 2007 3:23 PM by rddone

    tree control

    konlin77 Level 1
      trying to populate the tree control from my wsdl. The webservice returns - Firstname, address, phone # etc...
      basically want to to have the root of the tree control be the first name and the corresponding details nested.

      I've put the results of my webservice into an array collection, but I can't figure out how to display in tree properly.

      <mx:Tree x="10" y="10" width="354" height="570" dataProvider="{ac}" showRoot="false" labelField="@label">

      </mx:Tree>

      any help or ideas is appreciated.
      thanks.
        • 1. Re: tree control
          rddone Level 1
          I tried many different combinations of data format, HTTPService results format, dataProvider settings, and labelField settings without success until I decided to wait to set the dataProvider for the tree until after the data was returned from teh service. Now it works great.

          I used a nearly identical tree properties, except I used showRoot="true" and no dataProvider property.

          Then, in the HTTPService complete event I set the dataProvider and selection:
          thumbnailView.myTree.dataProvider = serviceList.lastResult.childNodes[0];
          thumbnailView.myTree.selectedIndex=0;

          Piece of cake now that I figured it out.

          Im thinking that declaring the dataProvider to the Tree control before the data was populated makes the Tree control have some default assumptions about how to display the data. Waiting to set the provider avoids those assumptions