6 Replies Latest reply on Jul 24, 2007 1:20 PM by RailsFlexer

    Using HTTPService as data provider for mx:ComboBox

    BTRichardson Level 1
      Hello all,

      I'm trying to use an HTTPService as a data provider for an mx:ComboBox. Here's how I have my HTTPService configured:

      <mx:HTTPService id="listStates" url=" http://localhost:3006/state/list" useProxy="false" method="GET" />

      I have a Rails backend setup and talking to a database on my local machine. I have a list of states in a table in my database, and the table has two columns: id and name. When I go to localhost:3006/state/list in my browser, I get the following XML:

      <states>
      <state>
      <id type="integer">1</id>
      <name>New Mexico</name>
      </state>
      <state>
      <id type="integer">2</id>
      <name>Arizona</name>
      </state>
      </states>

      I have my mx:ComboBox set up like so:

      <mx:ComboBox width="199" id="state" dataProvider="{ listStates.lastResult.states.state }" />

      However, when I browse to my .swf file, my state combo box shows [object Object] twice in the drop-down list. Anyone have any idea why it's not parsing the data correctly? Any suggestions on how to make it work?

      Thanks in advance!!! -- BTR