Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
Adobe Flex SDK 4.5 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce:
1. Create a combo box with validator. Try opening the combobox with Mouse and press any starting letter int he label. The error combo box closes without triggering the change handler
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*"
width="100%" height="100%">
<fx:Declarations>
<mx:NumberValidator id="editedComboBoxValidator" lowerThanMinError="Validation Error Here" minValue="0" property="selectedIndex"
required="true" source="
"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.ComboBox;
import mx.events.DropdownEvent;
import mx.events.FlexEvent;
import mx.events.ListEvent;
import mx.events.ValidationResultEvent;
import spark.events.DropDownEvent;
import spark.events.IndexChangeEvent;
protected function comboBoxChangeHandler(event:ListEvent):void
{ debug.text+=("[change handler] :" + ComboBox(event.currentTarget).selectedLabel.toString()+ "\n"); }
[Bindable]
private var collection:ArrayCollection=new ArrayCollection(["One","Two","Four","Six","Eight","Nine"])
protected function typeValidator_validHandler(event:ValidationResultEvent):void
{ // TODO Auto-generated method stub }protected function typeValidator_invalidHandler(event:ValidationResultEvent):void
{ // TODO Auto-generated method stub }
protected function comboBoxCloseHandler(event:DropdownEvent):void
{ // TODO Auto-generated method stub debug.text+=("[close Handler]:" + event.triggerEvent + "\n"); } ]]
>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<local:EditedComboBox id="editedComboBox" change="comboBoxChangeHandler(event)" close="comboBoxCloseHandler(event)"
dataProvider="
<mx:ComboBox id="mxComboBox" change="comboBoxChangeHandler(event)" close="comboBoxCloseHandler(event)" dataProvider="{collection}
"
prompt="Select one"/>
<mx:TextArea id="debug" width="300" height="400" editable="true"/>
</s:Application>
package
{
import flash.events.KeyboardEvent;
import mx.controls.ComboBox;
public class EditedComboBox extends ComboBox
{
public function EditedComboBox()
override protected function keyDownHandler(event:KeyboardEvent):void
{ super.keyDownHandler(event); //Hopefully quick stuff which i found is triggering the change handler. Didnt have time to check the full code though. dropdown.dispatchEvent(event.clone()); } }
}
2.This works fine when using Mouse alone.
3.
Actual Results:
The change handler is not triggered when using Mouse to open dropdown and type starting key stroke "for example 'e' for selecting 'Eight'. The drop down gets closed. Selectionindex got changed. but didnt trigger the change event.
Expected Results:
Change event should be triggerd.
Workaround (if any):
Listbase is not dispatching the "change" event.