FLEX-35328 - Update MDL DropDownList in MDLExample to usage of DataFieldProviderModel
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/141b10bb Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/141b10bb Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/141b10bb Branch: refs/heads/tlf Commit: 141b10bb74cae04325bab759cb098ba5c2157394 Parents: 5eb141e Author: piotrz <pio...@apache.org> Authored: Sun Jun 25 18:18:03 2017 +0200 Committer: piotrz <pio...@apache.org> Committed: Sun Jun 25 18:18:03 2017 +0200 ---------------------------------------------------------------------- examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml | 4 +++- examples/flexjs/MDLExample/src/main/flex/models/MenuModel.as | 8 ++++---- examples/flexjs/MDLExample/src/main/flex/vos/MenuItemVO.as | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/141b10bb/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 e17af31..14d14fd 100644 --- a/examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml +++ b/examples/flexjs/MDLExample/src/main/flex/DropDownList.mxml @@ -20,7 +20,8 @@ limitations under the License. <mdl:TabBarPanel xmlns:fx="http://ns.adobe.com/mxml/2009" 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.*"> + xmlns="http://www.w3.org/1999/xhtml" xmlns:models="models.*" + xmlns:models2="org.apache.flex.html.beads.models.*"> <mdl:beads> <js:ContainerDataBinding /> @@ -37,6 +38,7 @@ limitations under the License. sourceID="menuModel" sourcePropertyName="menuItems" destinationPropertyName="dataProvider" /> + <models2:DataFieldProviderModel dataField="value"/> </mdl:beads> </mdl:DropDownList> </mdl:GridCell> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/141b10bb/examples/flexjs/MDLExample/src/main/flex/models/MenuModel.as ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/models/MenuModel.as b/examples/flexjs/MDLExample/src/main/flex/models/MenuModel.as index bbae844..3cd0004 100644 --- a/examples/flexjs/MDLExample/src/main/flex/models/MenuModel.as +++ b/examples/flexjs/MDLExample/src/main/flex/models/MenuModel.as @@ -23,10 +23,10 @@ package models public class MenuModel { private var _menuItems:Array = [ - new MenuItemVO("Some Action"), - new MenuItemVO("Another Action", true), - new MenuItemVO("More Action"), - new MenuItemVO("Item Disabled", false, true) + new MenuItemVO("Some Action", "Some value"), + new MenuItemVO("Another Action", "Another value", true), + new MenuItemVO("More Action", "More value"), + new MenuItemVO("Item Disabled", "Disabled value", false, true) ]; public function get menuItems():Array http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/141b10bb/examples/flexjs/MDLExample/src/main/flex/vos/MenuItemVO.as ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/vos/MenuItemVO.as b/examples/flexjs/MDLExample/src/main/flex/vos/MenuItemVO.as index 691b18f..4ae4b46 100644 --- a/examples/flexjs/MDLExample/src/main/flex/vos/MenuItemVO.as +++ b/examples/flexjs/MDLExample/src/main/flex/vos/MenuItemVO.as @@ -22,12 +22,14 @@ package vos public class MenuItemVO { public var label:String; + public var value:String; public var disabled:Boolean; public var hasDivider:Boolean; - public function MenuItemVO(label:String, hasDivider:Boolean = false, disabled:Boolean = false) + public function MenuItemVO(label:String, value:String = "", hasDivider:Boolean = false, disabled:Boolean = false) { this.label = label; + this.value = value; this.hasDivider = hasDivider; this.disabled = disabled; }