Fill ArrayCollection to a DropDownList : DropDownList « Components « Flex






Fill ArrayCollection to a DropDownList

Fill ArrayCollection to a DropDownList
   


<?xml version='1.0' encoding='UTF-8'?>
<mx:Application
     xmlns:s="library://ns.adobe.com/flex/spark" 
     xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        import mx.controls.Alert; 
        public function showMsg(msg:String):void { 
            Alert.show(msg); 
        }
    </mx:Script>
    <mx:Panel width="400" height="150" title="Profile" horizontalCenter="0" verticalCenter="0">

        <s:HGroup>
            <mx:Label fontWeight="bold" text="Value:" />
            <s:DropDownList id="combo" close="showMsg('Value is ' + event.currentTarget.selectedItem)">
                <mx:ArrayCollection>
                    <mx:String>A</mx:String>
                    <mx:String>B</mx:String>
                    <mx:String>C</mx:String>
                </mx:ArrayCollection>
            </s:DropDownList>
            <mx:Label fontWeight="bold" text="With the color of:" />
            <mx:ColorPicker id="clr"
                change="showMsg('Color ' + event.currentTarget.selectedColor)" />
        </s:HGroup>

    </mx:Panel>
</mx:Application>

   
    
    
  








Related examples in the same category

1.Get current selected value from DropDownListGet current selected value from DropDownList
2.Enable a Group by checking a DropDownList selectionEnable a Group by checking a DropDownList selection
3.Trigger the drop down of DropDownListTrigger the drop down of DropDownList
4.DropDownList control with prompt messageDropDownList control with prompt message