You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2017/05/05 06:15:31 UTC

git commit: [flex-asjs] [refs/heads/develop] - Update MDL DropDownList example to show "selectedIndex" and "change" event working

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 15deae166 -> 009f555f4


Update MDL DropDownList example to show "selectedIndex" and "change" event working


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/009f555f
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/009f555f
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/009f555f

Branch: refs/heads/develop
Commit: 009f555f418a50357d4258f094a2f98242f0baef
Parents: 15deae1
Author: piotrz <pi...@apache.org>
Authored: Fri May 5 08:15:27 2017 +0200
Committer: piotrz <pi...@apache.org>
Committed: Fri May 5 08:15:27 2017 +0200

----------------------------------------------------------------------
 .../MDLExample/src/main/flex/DropDownList.mxml     | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/009f555f/examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml b/examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml
index 6faf981..48ccfa5 100644
--- a/examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml
@@ -21,12 +21,16 @@ limitations under the License.
                  xmlns:js="library://ns.apache.org/flexjs/basic"
                  xmlns:mdl="library://ns.apache.org/flexjs/mdl"
                  xmlns="http://www.w3.org/1999/xhtml" xmlns:models="models.*">
-    
+
+    <mdl:beads>
+        <js:ContainerDataBinding />
+    </mdl:beads>
     <mdl:model>
         <models:MenuModel id="menuModel"/>
     </mdl:model>
     <mdl:Grid width="100">
-      <mdl:DropDownList id="dropDownList" labelField="label" width="150">
+      <mdl:DropDownList id="dropDownList" labelField="label" width="150"
+                        selectedIndex="0" change="onDplChange(event)">
           <mdl:beads>
               <js:ConstantBinding
                       sourceID="menuModel"
@@ -34,5 +38,14 @@ limitations under the License.
                       destinationPropertyName="dataProvider" />
           </mdl:beads>
       </mdl:DropDownList>
+        <js:Label text="Selected index: {dropDownList.selectedIndex}"/>
+        <js:Label id="selectedItemChange"
+                  text="Selected item on 'change' event: "/>
     </mdl:Grid>
+    <fx:Script><![CDATA[        
+        public function onDplChange(event:Event):void
+        {
+            selectedItemChange.text = "Selected item on 'change' event:" + dropDownList.selectedItem.label;
+        }
+        ]]></fx:Script>
 </mdl:TabBarPanel>
\ No newline at end of file