You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/11/12 19:09:58 UTC

git commit: [flex-asjs] [refs/heads/develop] - fix form example

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 5909203b0 -> c27f0207e


fix form 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/c27f0207
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c27f0207
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c27f0207

Branch: refs/heads/develop
Commit: c27f0207e9cb6d4347511b0608339cdf074bf8ea
Parents: 5909203
Author: Alex Harui <ah...@apache.org>
Authored: Wed Nov 12 10:09:29 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Nov 12 10:09:29 2014 -0800

----------------------------------------------------------------------
 .../FlexJSJX/src/org/apache/flex/html/DateField.as      | 12 ++++++------
 .../flex/html/accessories/DateFormatMMDDYYYYBead.as     | 11 +++++++++--
 .../src/org/apache/flex/html/beads/DateChooserView.as   |  8 ++++----
 3 files changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c27f0207/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/DateField.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/DateField.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/DateField.as
index d1cf5f8..dfd2212 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/DateField.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/DateField.as
@@ -61,13 +61,13 @@ package org.apache.flex.html
 		 */
 		override public function addedToParent():void
 		{
+            var klass:* = ValuesManager.valuesImpl.getValue(this,"iFormatBead");
+            var bead:IBead = new klass() as IBead;
+            if (bead) {
+                addBead(bead);
+            }
+            
 			super.addedToParent();
-			
-			var klass:* = ValuesManager.valuesImpl.getValue(this,"iFormatBead");
-			var bead:IBead = new klass() as IBead;
-			if (bead) {
-				addBead(bead);
-			}
 		}
 		
 		/**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c27f0207/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/DateFormatMMDDYYYYBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/DateFormatMMDDYYYYBead.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/DateFormatMMDDYYYYBead.as
index c3e7c7e..94d7f20 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/DateFormatMMDDYYYYBead.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/DateFormatMMDDYYYYBead.as
@@ -22,6 +22,7 @@ package org.apache.flex.html.accessories
 	import org.apache.flex.core.IDateChooserModel;
 	import org.apache.flex.core.IFormatBead;
 	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IStrandWithModel;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.EventDispatcher;
 	import org.apache.flex.html.TextInput;
@@ -30,6 +31,8 @@ package org.apache.flex.html.accessories
 	/**
 	 * The DateFormatBead class formats the display of a DateField using MM/DD/YYYY format.
 	 *  
+     *  @flexjsignoreimport org.apache.flex.core.IStrandWithModel
+     * 
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
@@ -113,6 +116,8 @@ package org.apache.flex.html.accessories
 		/**
 		 *  @copy org.apache.flex.core.IBead#strand
 		 *  
+         *  @flexjsignorecoercion org.apache.flex.core.IStrandWithModel
+         * 
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
@@ -122,16 +127,18 @@ package org.apache.flex.html.accessories
 		{
 			_strand = value;
 			
-			var model:IDateChooserModel = _strand.getBeadByType(IDateChooserModel) as IDateChooserModel;
+			var model:IDateChooserModel = IStrandWithModel(_strand).model as IDateChooserModel;
 			model.addEventListener("selectedDateChanged",handleTextChange);
 		}
 		
 		/**
 		 * @private
+         * 
+         * @flexjsignorecoercion org.apache.flex.core.IStrandWithModel
 		 */
 		private function handleTextChange(event:Event):void
 		{
-			var model:IDateChooserModel = _strand.getBeadByType(IDateChooserModel) as IDateChooserModel;
+			var model:IDateChooserModel = IStrandWithModel(_strand).model as IDateChooserModel;
 			/*var view:DateFieldView = _strand.getBeadByType(DateFieldView) as DateFieldView;
 			var input:TextInput = view.textInput;*/
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c27f0207/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/DateChooserView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/DateChooserView.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/DateChooserView.as
index 51a709d..4baa17b 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/DateChooserView.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/DateChooserView.as
@@ -150,6 +150,8 @@ package org.apache.flex.html.beads
 			dayContainer = new Container();
 			var tileLayout:TileLayout = new TileLayout();
 			dayContainer.addBead(tileLayout);
+            UIBase(_strand).addElement(dayContainer, false);
+            
 			tileLayout.numColumns = 7;
 			dayContainer.x = 0;
 			dayContainer.y = monthLabel.y + monthLabel.height + 5;
@@ -165,7 +167,7 @@ package org.apache.flex.html.beads
 				var dayName:DateChooserButton = new DateChooserButton();
 				dayName.text = model.dayNames[i];
 				dayName.dayOfMonth = 0;
-				dayContainer.addElement(dayName);
+				dayContainer.addElement(dayName, false);
 			}
 			
 			_dayButtons = new Array();
@@ -173,12 +175,10 @@ package org.apache.flex.html.beads
 			for(i=0; i < 42; i++) {
 				var date:DateChooserButton = new DateChooserButton();
 				date.text = String(i+1);
-				dayContainer.addElement(date);
+				dayContainer.addElement(date, false);
 				dayButtons.push(date);
 			}
 			
-			UIBase(_strand).addElement(dayContainer);
-			
 			IEventDispatcher(dayContainer).dispatchEvent( new Event("itemsCreated") );			
 			IEventDispatcher(_strand).dispatchEvent( new Event("layoutNeeded") );			
 			IEventDispatcher(dayContainer).dispatchEvent( new Event("layoutNeeded") );