3 Replies Latest reply on Jan 16, 2014 6:36 AM by amitsharma001

    Flex 3 ComboBox Not Firing Change Event


      I have run into a peculiar behavior with the Flex 3 ComboBox. If you have a combo box that initially defaults to no item selected and a required validator, the behavior is incorrect given one particular set of user actions. See the below code which is a minimal application I came up with the reproduce the problem.


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
                  import mx.controls.Alert;
                  private function boxChanged(event:Event):void {
                      Alert.show("selection changed");
          <mx:Validator source="{box}" property="text" required="true"/>
              <mx:ComboBox id="box" change="boxChanged(event)" selectedIndex="-1">
                      <mx:Object label="A1" stuff="xxxx"/>
                      <mx:Object label="A2" stuff="xxxx"/>
                      <mx:Object label="B1" stuff="xxxx"/>
                      <mx:Object label="C1" stuff="xxxx"/>
                      <mx:Object label="C2" stuff="xxxx"/>


      If you use only the mouse to select an item from the combo box, it works fine. If you tab into it and use keystrokes to select an item, it works fine. However, if you click the down arrow with the mouse to display the list and then hit a key (e.g. A or B or C), it immediately selects that item in the list (normally, it just highlights the first matching entry and you have to click or hit enter to actually select it) but does not dispatch the change event. Once you have selected the item the first time, the same click and keypress combination works correctly ... it only fails the first time when the combo box doesn't have an item selected. And it only happens if there is a required validator on the field ... if you remove the validator, it works correctly.


      Any ideas what is going on? And any suggestions for a workaround that achieves the same result but bypasses this issue (which appears to me to be a bug in the ComboBox control)? Upgrading to a newer version, sadly, is not an option for us at this time. Thanks.

        • 1. Re: Flex 3 ComboBox Not Firing Change Event
          wbailey4 Level 1

          As luck would have it, I found a workaround shortly after posting this. If you add the 'prompt' property (e.g. prompt="Select") to the combo box such that it does not display blank initially, it fixes the problem. Further evidence I think that this is a bug since I can't think of a logical reason this should have fixed it.

          • 2. Re: Flex 3 ComboBox Not Firing Change Event

            Hi wbailey4,


            i have a flex 3 project someone developed it and he wirte the code such as the below example:


                        id="providerItem" width="100%"

                        label="Provider"  >







                            styleName="formField" tabIndex="1105"/>




            i have similar problem as you mentioned above, but it seems he use a different approach to create the ComboBox in the mxml file, and i added the prompt property such as you mentioned befire, but unfortunately it still not working, do you have any idea !!!...


            thanks in advance,

            • 3. Re: Flex 3 ComboBox Not Firing Change Event

              Try using the valueComit property on mx combobox.