0 Replies Latest reply on Dec 9, 2013 11:51 PM by LynSing717

    Flex 4 display selected item from spark DropDownList

    LynSing717

      Hi, I am newbie to Flex, I has a question to display the currently selected item from the DropDownList control(s) in the application. For example totalscreen that drop down with [1, 2, 3, 4] if 3 is selected then the only items in localscreen drop down will be [1, 2,3] and if the 2 is selected,for the nextworkscreen will only have 1 is display. I am using the dropdownlist and ArrayCollection.

       

      enter image description here

      private function updateLocal(event:IndexChangeEvent):void

      {

                     var aLocal:Array = [];

                     var idx:uint;

                     var length:uint = totalscreenSelect.selectedItem.data;

                     for(idx=0; idx<length; idx++)

                     {

                             aLocal.push({data:"label"+idx});

                     }

      }

       

       

      i try to use Array and  using ArrayCollection too, however there are error also.

       

      <s:DropDownList id="totalscreenSelect" dataProvider="{_dataProviders}" change="updateLocal(event);"/>

       

       

       

      Any thoughts on if this is possible and if so how to implement it would really be appreciated.

       

      Thanks in advance.

       

       

      Using Flash Builder 4.7 with Apache Flex 4.11 sdk