1 Reply Latest reply on Jan 31, 2008 10:57 AM by Ratsnackbar

    Have a combobox pre-filled using data from database

    webvalue Level 1
      What would be a recommended method to have a combobox pre-filled using data from database?
        • 1. Re: Have a combobox pre-filled using data from database
          Ratsnackbar Level 2
          You can load an Array with the data returned from your database and bind to that array as the dataProvider for the comboBox.

          [Bindable]
          private var myArrayDP:Array = new Array();

          //Load the array with your returned data.

          <mx:ComboBox dataProvider="{this.myArrayDP}">
          </mx:ComboBox>

          Using an ArrayCollection however is often better if you want changes to the dataProvider to automatically reflect in the ComboBox.