This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6fa503a  make external change in ComboBox fire change event
6fa503a is described below

commit 6fa503a6fab8dd28f6de94b25f9b46d72bcd33c9
Author: Carlos Rovira <carlosrov...@apache.org>
AuthorDate: Tue Aug 28 14:05:58 2018 +0200

    make external change in ComboBox fire change event
---
 .../JewelExample/src/main/royale/DropDownListPlayGround.mxml     | 8 ++++----
 examples/royale/JewelExample/src/main/royale/ListPlayGround.mxml | 9 ++-------
 .../royale/org/apache/royale/jewel/beads/views/ComboBoxView.as   | 3 ++-
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git 
a/examples/royale/JewelExample/src/main/royale/DropDownListPlayGround.mxml 
b/examples/royale/JewelExample/src/main/royale/DropDownListPlayGround.mxml
index 0512bf5..568246d 100644
--- a/examples/royale/JewelExample/src/main/royale/DropDownListPlayGround.mxml
+++ b/examples/royale/JewelExample/src/main/royale/DropDownListPlayGround.mxml
@@ -26,19 +26,19 @@ limitations under the License.
        <fx:Script>
                <![CDATA[
             private function watchmenDropDownListHandler(event:Event):void {
-                watchmenDropDownListResult.html = "<strong>DropDownList 
selectedItem:</strong> " + (event.target as DropDownList).selectedItem;
+                watchmenDropDownListResult.html = "<strong>DropDownList 
selectedItem:</strong> " + event.target.selectedItem;
             }
 
             private function watchmenComboBoxSelectedItem(event:Event):void {
-                               watchmenComboBoxResult.html = "<strong>ComboBox 
selectedItem:</strong> " + (event.target as ComboBox).selectedItem;
+                               watchmenComboBoxResult.html = "<strong>ComboBox 
selectedItem:</strong> " + event.target.selectedItem;
             }
             
                        private function 
avengersDropDownListHandler(event:Event):void {
-                avengersDropDownListResult.html = "<strong>DropDownList 
selectedItem:</strong> " + (event.target as DropDownList).selectedItem.nickname;
+                avengersDropDownListResult.html = "<strong>DropDownList 
selectedItem:</strong> " + event.target.selectedItem.nickname;
             }
 
             private function avengersComboBoxSelectedItem(event:Event):void {
-                               avengersComboBoxResult.html = "<strong>ComboBox 
selectedItem:</strong> " + (event.target as ComboBox).selectedItem.nickname;
+                               avengersComboBoxResult.html = "<strong>ComboBox 
selectedItem:</strong> " + event.target.selectedItem.nickname;
             }
                ]]>
        </fx:Script>
diff --git a/examples/royale/JewelExample/src/main/royale/ListPlayGround.mxml 
b/examples/royale/JewelExample/src/main/royale/ListPlayGround.mxml
index 49aecdb..11568a2 100644
--- a/examples/royale/JewelExample/src/main/royale/ListPlayGround.mxml
+++ b/examples/royale/JewelExample/src/main/royale/ListPlayGround.mxml
@@ -34,6 +34,7 @@ limitations under the License.
 
             private var _simple:ArrayList = new ArrayList(["Blueberries", 
"Bananas", "Lemons", "Oranges", "Watermelons", "Apples", "Cherries", 
"Coconuts", "Figs", "Grapes", "Kiwis", "Mangos"]);
 
+                       [Bindable]
                        public function get simple():ArrayList
                        {
                                return _simple
@@ -102,13 +103,7 @@ limitations under the License.
                                        phoneNumerator="1" phoneDenominator="1">
                        <j:Card>
                                <html:H3 text="Jewel List"/>
-                               <j:List id="list" width="200" height="300" 
change="onChange(event)">
-                                       <j:beads>
-                                               <js:ConstantBinding
-                                                       
sourcePropertyName="simple"
-                                                       
destinationPropertyName="dataProvider" />
-                                       </j:beads>
-                               </j:List>
+                               <j:List id="list" width="200" height="300" 
dataProvider="{simple}" change="onChange(event)"/>
                                <j:Label id="selected"/>
                                <j:HGroup gap="3" 
itemsVerticalAlign="itemsCentered">
                                        <j:Label text="Select List Index: "/>
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
index 14e8c8c..bb698a7 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
@@ -25,7 +25,6 @@ package org.apache.royale.jewel.beads.views
        import org.apache.royale.core.ValuesManager;
        import org.apache.royale.jewel.TextInput;
        import org.apache.royale.jewel.Button;
-       import org.apache.royale.jewel.Button;
        import org.apache.royale.jewel.List;
        import org.apache.royale.events.IEventDispatcher;
        import org.apache.royale.events.Event;
@@ -190,6 +189,8 @@ package org.apache.royale.jewel.beads.views
                protected function handleItemChange(event:Event):void
                {
                        itemChangeAction();
+
+                       IEventDispatcher(_strand).dispatchEvent(new 
Event("change"));
                }
                
                /**

Reply via email to