You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2014/03/02 13:38:51 UTC

git commit: [flex-asjs] [refs/heads/develop] - solved text input change thanks to Alex stopinmediatepropagation and setting the listener in constructor

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 86d14e243 -> 3d7e4f0e0


solved text input change thanks to Alex stopinmediatepropagation and setting the listener in constructor


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

Branch: refs/heads/develop
Commit: 3d7e4f0e0e8dfdb12b413d030a1e656479f827e6
Parents: 86d14e2
Author: Carlos Rovira <ca...@apache.org>
Authored: Sun Mar 2 13:38:41 2014 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Sun Mar 2 13:38:41 2014 +0100

----------------------------------------------------------------------
 .../src/org/apache/flex/events/Event.as         |  2 ++
 .../flex/html/staticControls/TextInput.as       | 27 +++-----------------
 2 files changed, 6 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3d7e4f0e/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/Event.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/Event.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/Event.as
index 4c23e7f..764240e 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/Event.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/Event.as
@@ -35,6 +35,8 @@ package org.apache.flex.events
 	 */
 	public class Event extends flash.events.Event
 	{
+		public static const CHANGE:String = "change";
+
         /**
          *  Constructor.
          *  

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3d7e4f0e/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 7b3ff90..ce85fa4 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,9 +19,8 @@ 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.
      *
@@ -54,6 +53,8 @@ package org.apache.flex.html.staticControls
 		public function TextInput()
 		{
 			super();
+
+			model.addEventListener("textChange", textChangeHandler);
 		}
 		
         /**
@@ -97,25 +98,6 @@ 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
@@ -127,8 +109,7 @@ package org.apache.flex.html.staticControls
 		 */
 		public function textChangeHandler(event:Event):void
 		{
-            // this is not working as expected
-			dispatchEvent(new Event("change"));
+            dispatchEvent(new Event(Event.CHANGE));
 		}
 	}
 }
\ No newline at end of file