TextArea maxrows and disabled textfield example
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b31b86f6 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b31b86f6 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b31b86f6 Branch: refs/heads/feature/fontawesome Commit: b31b86f6556bd3286b95ff1d6276dabf21b4e24f Parents: bcc0953 Author: Carlos Rovira <[email protected]> Authored: Sun Jan 1 19:37:58 2017 +0100 Committer: Carlos Rovira <[email protected]> Committed: Sun Jan 1 19:37:58 2017 +0100 ---------------------------------------------------------------------- .../MDLExample/src/main/flex/TextFields.mxml | 12 ++++++++-- .../main/flex/org/apache/flex/mdl/TextArea.as | 24 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b31b86f6/examples/flexjs/MDLExample/src/main/flex/TextFields.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/TextFields.mxml b/examples/flexjs/MDLExample/src/main/flex/TextFields.mxml index acac84b..9cbf2ae 100644 --- a/examples/flexjs/MDLExample/src/main/flex/TextFields.mxml +++ b/examples/flexjs/MDLExample/src/main/flex/TextFields.mxml @@ -30,6 +30,14 @@ limitations under the License. <mdl:TextField id="mdlti" change="mdlfloatingti.text = mdlti.text" width="100%"> <mdl:beads> <mdl:TextPrompt prompt="Normal Text Field..."/> + <mdl:Tooltip text="A simple tooltip in a TextField"/> + </mdl:beads> + </mdl:TextField> + + <mdl:TextField width="100%"> + <mdl:beads> + <mdl:Disabled/> + <mdl:TextPrompt prompt="Disabled..."/> </mdl:beads> </mdl:TextField> @@ -66,9 +74,9 @@ limitations under the License. </mdl:beads> </mdl:TextArea> - <mdl:TextArea floatingLabel="true" width="100%" rows="5"> + <mdl:TextArea floatingLabel="true" width="100%" rows="5" maxrows="8"> <mdl:beads> - <mdl:TextPrompt prompt="Text lines, floating and only letters..."/> + <mdl:TextPrompt prompt="Floating, maxrows 8 and only letters..."/> <mdl:Restrict pattern="[A-Z,a-z, ]*" error="Letters and spaces only"/> </mdl:beads> </mdl:TextArea> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b31b86f6/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextArea.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextArea.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextArea.as index dda2668..167485f 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextArea.as +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextArea.as @@ -77,6 +77,29 @@ package org.apache.flex.mdl } } + private var _maxrows:int = 0; + /** + * The max number of rows in the textarea. Defaults to 0 + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get maxrows():int + { + return _maxrows; + } + public function set maxrows(value:int):void + { + _maxrows = value; + + COMPILE::JS + { + input.setAttribute('maxrows', _maxrows); + } + } + COMPILE::JS { private var _textNode:Text; @@ -134,6 +157,7 @@ package org.apache.flex.mdl input = document.createElement('textarea') as HTMLInputElement; input.setAttribute('type', 'text'); input.setAttribute('rows', rows); + //input.setAttribute('maxrows', maxrows); input.className = "mdl-textfield__input"; //attach input handler to dispatch flexjs change event when user write in textinput
