You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2021/02/23 15:52:56 UTC

[royale-asjs] branch develop updated: Added value property to Textarea

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

harbs 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 f5a3c35  Added value property to Textarea
f5a3c35 is described below

commit f5a3c35e9d83508c138bc5dbd606716dfc334b12
Author: Harbs <ha...@in-tools.com>
AuthorDate: Tue Feb 23 17:52:38 2021 +0200

    Added value property to Textarea
---
 .../org/apache/royale/html/elements/Textarea.as    | 45 +++++++++++++++++++---
 1 file changed, 40 insertions(+), 5 deletions(-)

diff --git a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Textarea.as b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Textarea.as
index 3c0ce0d..2fdb742 100644
--- a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Textarea.as
+++ b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Textarea.as
@@ -227,10 +227,45 @@ package org.apache.royale.html.elements
             super.name = value;
         }
 
-        COMPILE::JS
-        override protected function createElement():WrappedHTMLElement
-        {
+		COMPILE::SWF
+		private var _value:String = "";
+
+		/**
+		 *  The current value of the textarea
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 */
+		public function get value():String
+		{
+			COMPILE::SWF
+			{
+				return _value;
+			}
+			COMPILE::JS
+			{
+				return textarea.value;
+			}
+		}
+
+		public function set value(value:String):void
+		{
+			COMPILE::SWF
+			{
+				_value = value;
+			}
+			COMPILE::JS
+			{
+				textarea.value = value;
+			}
+		}
+
+		COMPILE::JS
+		override protected function createElement():WrappedHTMLElement
+		{
 			return addElementToWrapper(this,'textarea');
-        }
-    }
+		}
+	}
 }