3 Replies Latest reply on Jul 31, 2007 7:31 PM by ntsiii

    Dynamically add element to dataProvider array.

    Level 7
      <?xml version="1.0" encoding="utf-8"?>
      <mx:ComboBox xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:dataProvider>
      <mx:String>Reported</mx:String>
      <mx:String>Assigned</mx:String>
      <mx:String>Closed</mx:String>
      </mx:dataProvider>
      </mx:ComboBox>

      I have this comboBox custom control that I use for a form input. I
      would also like to use it for a filter form control. But for the filter
      the dataProvider array should also contain an "All" element that is not
      relevant for the input form. Is there some way to dynamically add an
      element to this control when I use it in the filter form?

      <mx:FormItem label="Status:" width="100%">
      <Ctrl:statusComboBox
      id="filter_status"
      width="100%"
      change="{dispatchEvent (new Event('filterUpdateEvent'))}"/>
      </mx:FormItem>

      I am hoping to use the same control for both forms so that if and when
      the list of status values is updated there is one common location for them.

      TIA
      Ian Skinner