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 <[email protected]> Authored: Fri May 5 08:15:27 2017 +0200 Committer: piotrz <[email protected]> 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
