6 Replies Latest reply on May 14, 2009 4:23 PM by Flex harUI

    Custom Combobox "selectedItem" problem

    srini kusunam Level 1


      "selectedItem" sometime works and sometime doesn't in custom combobox.



      I have a "Search" screen and after user enters Search Criteria and hit "Search" button it goes through Cairngorm Event to Command to Delegate and then retrieve VO from DB and assign it to Model and then view is forwarded to "Display" screen where i have around 13 custom combo boxes. Each custom combo box look like following:


      <!-- MXML with a Cusotm Combobox --->

      <custom:CustomSelectedComboBox id="vehicleTypeCB"




                               prompt="Select one..."/>


      <!-- Cusotm Combobox --->











      public class CustomSelectedComboBox extends ComboBox
           public function CustomSelectedComboBox()
                this.rowCount = 10;
           // value is the value you input that you want to search for.
           override public function set selectedItem(value:Object):void
                if (value != null && selectedIndex == -1)
                     /** do a painful search */
                     for each(var item:Object in this.collection)
                          //Vdata is the Arraycollection item you whant to search in.
                          //So VData is the name of the item within the ArrayCollection
                          if (item.code == value )











      If i put just 1 custom combobox instead of 13 it works fine but if i put all 13 only 2 or 3 shows up fine.


      I am sure there is something i am missing which causing this weird behavior. I appreciate any help.