4 Replies Latest reply on Aug 26, 2007 11:59 PM by chris.huston.t10

    ComboBox XML Data Provider

      Hello all,

      I'm having trouble creating an XML data provider to use for a ComboBox. Below is what I've done:

      XML data I get from Rails server:
      <state name="Arizona" id="1" />

      import mx.rpc.events.ResultEvent;
      import mx.collections.ArrayCollection;

      [Bindable] private var stateData:ArrayCollection;

      private function getStates(event:ResultEvent):void {
      stateData = (event.result as XML).states.state;
      state.dataProvider = stateData;
      state.labelField = "name";
      state.data = "id";

      <mx:ComboBox id="state" />

      This compiles, but when I run it, I don't get anything in the ComboBox. I know I'm getting data from the server, because I can set the data provider for the ComboBox to be event.result and I see all the resulting XML in the ComboBox.

      Please help!!! What am I doing wrong here?!

      Thanks in advance! -- BTR