3 Replies Latest reply on May 29, 2011 6:31 PM by chan555

    ComboBox open and then immediately close


      I migrate Flex 3 applications to Flex 4. After installation of Flex 4.5 sdk,  i click a ComboBox , it open and then immediately close. How to solve this problems. Thank You.....

        • 1. Re: ComboBox open and then immediately close
          Timothy Brand-Spencer Level 1

          Please post your combobox code along with any listener functions you have attached to it.

          • 2. Re: ComboBox open and then immediately close
            JeffryHouser Level 4

            Can you share some code?


            Are you using the official release of the Flex 4.5 SDK?  Or do you have the preview release?


            This was a big problem with the preview release of the Flex Hero SDK when using a ComboBox or DropDownList on a device that uses touch interaction.  Such problems went away with the 'gold' release.  However, I have never seen the issue in traditional apps.  .

            • 3. Re: ComboBox open and then immediately close
              chan555 Level 1

              Flex 4.5 SDK downloaded from following link.



              Code is below.Thank You Very Much...........



              <?xml version="1.0" encoding="utf-8"?>
              <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:esri="http://www.esri.com/2008/ags" xmlns:TextualSearch="TextualSearch.*" creationComplete="onCreationComplete()">
              <mx:Label text="Textual Search" fontSize="12" fontWeight="bold">
                 <mx:DropShadowFilter alpha="0.5"/>

              <mx:ComboBox id="cbbSearchField" width="240" selectedIndex="0" rowCount="30" change="onChange()">
                 <mx:String>Man-made Features</mx:String>    <!--  0 -->
                 <mx:String>Historical Landslip Catchments</mx:String> <!--  1 -->
                 <mx:String>NPRS Slope</mx:String>      <!--  2 -->

              <TextualSearch:ManMadeFeatureSearchVBox id="mManMadeFeatureSearchVBox" HOSTNAME="{mHOSTNAME}" Map="{mMap}" GraphicsLayer="{mGraphicsLayer}" includeInLayout="true" visible="true"/>
              <TextualSearch:HLCSearchVBox id="mHLCSearchVBox" HOSTNAME="{mHOSTNAME}" Map="{mMap}" GraphicsLayer="{mGraphicsLayer}" includeInLayout="false" visible="false"/>
              <TextualSearch:NPRSSlopeSearchVBox id="mNPRSSlopeSearchVBox" HOSTNAME="{mHOSTNAME}" Map="{mMap}" GraphicsLayer="{mGraphicsLayer}" includeInLayout="false" visible="false"/>
                 import com.esri.ags.Map;
                 import com.esri.ags.layers.GraphicsLayer;
                 import mx.controls.Alert;
                 import mx.collections.ArrayCollection;
                 import mx.core.Application;
                 [Bindable] private var mHOSTNAME:String;
                 [Bindable] private var mApplication:Application;
                 [Bindable] private var mMap:Map;
                 [Bindable] private var mGraphicsLayer:GraphicsLayer;
                 private var mVBoxs:ArrayCollection = new ArrayCollection();
                 public function set HOSTNAME(pHOSTNAME:String):void { mHOSTNAME = pHOSTNAME; }
                 public function set Application(pApplication:Application):void { mApplication = pApplication; }
                 public function set Map(pMap:Map):void { mMap = pMap; }
                 public function set GraphicsLayer(pGraphicsLayer:GraphicsLayer):void { mGraphicsLayer = pGraphicsLayer; }
                 private function onCreationComplete():void {
                  mVBoxs.addItem(mManMadeFeatureSearchVBox);   //0
                  mVBoxs.addItem(mHLCSearchVBox);      //1
                  mVBoxs.addItem(mNPRSSlopeSearchVBox);    //2
                 private function onChange():void {
                  for (var i:int=0;i<mVBoxs.length;i++) {
                   var mTemp:VBox = mVBoxs.getItemAt(i) as VBox;
                   if (cbbSearchField.selectedIndex == i) {
                    mTemp.includeInLayout = true;
                    mTemp.visible = true;
                   else {
                    mTemp.includeInLayout = false;
                    mTemp.visible = false;