flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [1/2] git commit: [flex-asjs] [refs/heads/develop] - added change event to TextInput to be dispatched when textChange fires. This need revision since is not working as expected.
Date Sat, 01 Mar 2014 10:47:49 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop c7547b689 -> b45e0a373


added change event to TextInput to be dispatched when textChange fires. This need revision
since is not working as expected.


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

Branch: refs/heads/develop
Commit: dc2d8364393aa29df8c38f3fb91082bfab4f6036
Parents: c7547b6
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Sat Mar 1 11:44:47 2014 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Sat Mar 1 11:44:47 2014 +0100

----------------------------------------------------------------------
 .../flex/html/staticControls/TextInput.as       | 44 ++++++++++++++++++++
 1 file changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dc2d8364/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/TextInput.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/TextInput.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/TextInput.as
index 66ae3c7..7b3ff90 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/TextInput.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/staticControls/TextInput.as
@@ -19,7 +19,19 @@ package org.apache.flex.html.staticControls
 {
 	import org.apache.flex.core.ITextModel;
 	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.IStrand;	
+	import org.apache.flex.events.Event;
 	
+	/**
+     *  Dispatched when the user changes the text.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	[Event(name="change", type="org.apache.flex.events.Event")]
+
     /**
      *  The TextInput class implements the basic control for
      *  single-line text input.
@@ -86,5 +98,37 @@ package org.apache.flex.html.staticControls
 			ITextModel(model).html = value;
 		}
 		
+		private var _strand:IStrand;
+
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function set strand(value:IStrand):void
+        {
+            _strand = value;
+
+	        // this is not working as expected
+            model = UIBase(_strand).model as ITextModel;
+            model.addEventListener("textChange", textChangeHandler);
+        }
+
+		/**
+		 * @dispatch change event in response to a textChange event
+		 *
+		 *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+		 */
+		public function textChangeHandler(event:Event):void
+		{
+            // this is not working as expected
+			dispatchEvent(new Event("change"));
+		}
 	}
 }
\ No newline at end of file


Mime
View raw message