FLEX-35328 - Make "change" event working for DropDownList
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f74836d4 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f74836d4 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f74836d4 Branch: refs/heads/develop Commit: f74836d4f5016c550f34fac7cd9c8dc17dced31d Parents: 0c7da1b Author: piotrz <pio...@apache.org> Authored: Sat Jun 24 14:39:57 2017 +0200 Committer: piotrz <pio...@apache.org> Committed: Sat Jun 24 14:39:57 2017 +0200 ---------------------------------------------------------------------- .../flex/mdl/beads/controllers/DropDownListController.as | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f74836d4/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/DropDownListController.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/DropDownListController.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/DropDownListController.as index bd9bf3b..ed1a90c 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/DropDownListController.as +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/controllers/DropDownListController.as @@ -18,10 +18,9 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.mdl.beads.controllers { - import org.apache.flex.core.IBeadController; + import org.apache.flex.core.IBeadController; import org.apache.flex.core.ISelectionModel; import org.apache.flex.core.IStrand; - import org.apache.flex.events.IEventDispatcher; import org.apache.flex.mdl.DropDownList; import org.apache.flex.events.Event; @@ -77,19 +76,17 @@ package org.apache.flex.mdl.beads.controllers COMPILE::JS { - dropDownList.dropDown.element.addEventListener("onchange", onDisplayItemClick, false); + dropDownList.dropDown.element.addEventListener(Event.CHANGE, onSelectChanged, false); } } COMPILE::JS - private function onDisplayItemClick(event:Event):void + private function onSelectChanged(event:Event):void { var eventTarget:Object = event.target; model.selectedIndex = eventTarget.selectedIndex; model.selectedItem = model.dataProvider[model.selectedIndex]; - - IEventDispatcher(_strand).dispatchEvent(new Event(Event.CHANGE)); } } }