2 Replies Latest reply on May 8, 2012 5:25 AM by JorAndra026

    Checkbox combobox with itemrenderer

    JorAndra026

      Hi all,

       

      I have a combobox that is filled with checkboxes using a itemrenderer:

       

      [Bindable]

                  private var meses:ArrayCollection =new ArrayCollection([

                      {label:'Ene', selected: true},

                      {label:'Feb', selected: true},

                      {label:'Mar', selected: true},

                      {label:'Abr', selected: true},

                      {label:'May', selected: true},

                      {label:'Jun', selected: true},

                      {label:'Jul', selected: true},

                      {label:'Ago', selected: true},

                      {label:'Sep', selected: true},

                      {label:'Oct', selected: true},

                      {label:'Nov', selected: true},

                      {label:'Dic', selected: true}

                  ]);

       

       

      <mx:ComboBox id="myCombo" initialize="myCombo.dataProvider = meses"  change="filtromeses()">

           <mx:itemRenderer>

                <mx:Component>

                     <mx:CheckBox selectedField="selected" change="data.selected = selected" />    

                </mx:Component>

           </mx:itemRenderer>

      </mx:ComboBox>

       

      Now, the checkboxes are fine. I have the function: "filtromeses()" that works fine and the change="data.selected = selected" from the Checkbox also works fine changing the selected value of the array. The problem is, that i need to make the change="data.selected = selected" to occur first and then the "filtromeses()". The way that it is right now, when i click on a checkbox the function "filtromeses()" happends first and then the value of the checkbos changes with change="data.selected = selected".

       

      How can i make the other one to happend first?

       

      Thanks.