Get current selected value from DropDownList : DropDownList « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » DropDownList 




Get current selected value from DropDownList
Get current selected value from 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="Favorite car maker:" />
            <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.Fill ArrayCollection to a DropDownListFill ArrayCollection to a 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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.