3 Replies Latest reply on Mar 23, 2011 7:45 AM by EWN-CMI

    ComboBox - Is this a bug or Can it be fixed?

    EWN-CMI Level 1

      Both ComboBoxes initialize fine, but when the following code executes, the renderer for groupCombo0 gets resized to like 3 or 4 times the height instead of the expected single row?  The data is updated, and group0 looks fine, group0 is in the currentState, groupCombo0 is in another State.  I don't have a clue?  The mxml for the ComboBoxes is at the bottom.  All help is appreciated.

       

       

                            case "grouptype": {
                                parentApplication.grouptype=table;
                                parentApplication.grouptype.unshift(parentApplication.blank);
                                group0.dataProvider=new ArrayCollection(parentApplication.grouptype);
                                group0.dataProvider.refresh();
                                group0.dropdown.dataProvider=new ArrayCollection(parentApplication.grouptype);
                                group0.dropdown.dataProvider.refresh();
                                groupCombo0.dataProvider=new ArrayCollection(parentApplication.grouptype);
                                groupCombo0.dataProvider.refresh();
                                groupCombo0.dropdown.dataProvider=new ArrayCollection(parentApplication.grouptype);
                                groupCombo0.dropdown.dataProvider.refresh();
                              break;
                             }

      MXML

       

      <mx:ComboBox x="126.5" y="94" width="132" id="group0" dataProvider="{parentApplication.grouptype}" labelField="Description"  change="remCB=true;"/>

       

      <mx:ComboBox x="99" y="168" width="124" id="groupCombo0"  dataProvider="{parentApplication.grouptype}" labelField="Description" change="handleGroup(event);"/>

        • 1. Re: ComboBox - Is this a bug or Can it be fixed?
          Flex harUI Adobe Employee

          What do you mean by "renderer"?  The dropdown?

           

          I noticed the width is smaller, maybe that's a factor?

          • 2. Re: ComboBox - Is this a bug or Can it be fixed?
            EWN-CMI Level 1

            Yes, I also noticed the width being different, though on initialization both get populated and display properly.  I used the word renderer to generate the impression of an item renderer look to the drop down (multiple lines per data provider) when it goes bad.  It's weird that one of the ComboBoxes updates as expected but the one not displayed does not.  I tried to use the same ComboBox in both states, but could not get the Change Event to work - Coercion error.  My application has many modules, each with a set of ComboBoxes to filter a list to create a subset from which to select a working group.  Then change states to various forms, some of which allow for the addition of new data items to the ComboBox dataProviders.  The as code shown is  called after adding a new data Item with the goal of simply updating both ComboBoxes to show the new value in the list.  I appreciate the help and thanks for your time.

            • 3. Re: ComboBox - Is this a bug or Can it be fixed?
              EWN-CMI Level 1

              Well, I figured a work around - instead of the original code I now set a flag if any of the ComboBoxes dataProviders have changed when updating the original ComboBox, then I switch States as before then check the flags and refresh the other ComboBox on that state.  A lot of extra code, but it works.