3/24/2011 10:33:45 PM
Title:
ComboBox Event
hello
I am having combobox in my application, and on change i write some method in which i have code of visibility of other component.
Now the problem is when i only open the combo box and selects nothing then it will nt call that method so the code will not work.
So i want some help on which event i shud call this function. as I called it on close its giving me error
Please Help..
3/25/2011 3:12:09 AM
First my question is, why do u even want to trigger an event when the user doesn't change the combo box data??
and suppose initially first data is already selected and ur event doesn't get trigerred do the following..
1)Put --Select-- as ur first data in the data provider and give its "id" field as "". and other data in the combobox has its valid "id". so u can trigger the event when the user changes the dropdown.
3/26/2011 11:05:39 AM
very unusual case but this code with close event handler for combobox in flex will work
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768">
<mx:Script>
<![CDATA[
import mx.events.DropdownEvent;
protected function combobox1_closeHandler(event:DropdownEvent):void
{
trace( event.currentTarget.selectedIndex)
}
]]>
</mx:Script>
<mx:ComboBox x="113" y="69" close="combobox1_closeHandler(event)">
<mx:dataProvider>
<mx:Array>
<mx:String>A</mx:String>
<mx:String>B</mx:String>
<mx:String>C</mx:String>
<mx:String>D</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ComboBox>
</mx:Application>
3/26/2011 11:53:53 AM
close event should work whats the error