6 Replies Latest reply on Jul 15, 2009 4:25 AM by *Prashant Shelke*

    Setting combobox index value

    vertmonkee

      I have a combobox which I am populating from some XML.

       

      The XML is as follows

       

      <?xml version="1.0" encoding="UTF-8"?>
      <eventTypes>
        <eventType>
          <eventTypeID>1</eventTypeID>
          <eventTypeDescription>Event</eventTypeDescription>
        </eventType>
        <eventType>
          <eventTypeID>2</eventTypeID>
          <eventTypeDescription>Seminar</eventTypeDescription>
        </eventType>
        <eventType>
          <eventTypeID>3</eventTypeID>
          <eventTypeDescription>Social Occasion</eventTypeDescription>
        </eventType>
      </eventTypes>

      I am populating the comobobox using an array collection based on this XML.

      What I want to be able to do is set the index for each item in the combobox equal to the eventTypeID node in the XML.

      Is it possible to do this? If so how.

      Currently my MXML for the combobox is like this

      <mx:ComboBox id="calendarEventTypeID" dataProvider="{eventsTypeDataProvider}"
           editable="false" labelField="eventTypeDescription"/>

      Thanks for any help.