1 Reply Latest reply on Feb 26, 2007 1:44 PM by peterent

    HTTPService feeding ComboBox

      Hello Everybody,

      I have a problem feeding XML data in a combobox .

      result="ShowActivities()" ( I do nothing here )
      url= " http://localhost/party_apps/GetActivities.cfm">

      <mx:ArrayCollection id="ActivitiesList" source="{ArrayUtil.toArray(GetActivities.lastResult.activities.item)}"/>

      <mx:ComboBox dataProvider="{ActivitiesList}" labelField="description" x="544" y="63" id="Activity0" fontSize="11"/>

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

      <description>Administration / Secteur public</description>

      <description>Associations / Fédérations / Syndicats</description>






      <description>Immobilier / Construction</description>



      GetActivities.send() is executed on initialize of the mx:application

      My combobox gets filled with [object Object], [object Object],[object Object],[object Object],[object Object], ...

      What am I doing wrong ?
      Thanks in advance for your help, have a nice day,

        • 1. Re: HTTPService feeding ComboBox
          peterent Level 2
          In this case you do not want to use ArrayUtil. The result from your service is XML, not something you want to turn into an Array.

          The lastResult.activities.item is an XMLList - even if it has 1 element. That's a great parameter to give to XMLListCollection:

          <mx:XMLListCollection id="ActivitiesList" source="{GetActivities.lastResult.activities.item}" />

          Use that instead of ArrayCollection.