flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [37/53] git commit: [flex-asjs] [refs/heads/feature/mdl] - Added proper setter/getting functions for member property in model so js-release version will work.
Date Thu, 10 Nov 2016 09:23:44 GMT
Added proper setter/getting functions for member property in model so js-release version will
work.


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

Branch: refs/heads/feature/mdl
Commit: 72c1e1ff82615106ed3c2f0713896cbe2f3a2c0a
Parents: f4caf2c
Author: Peter Ent <pent@apache.org>
Authored: Tue Nov 8 14:56:18 2016 -0500
Committer: Peter Ent <pent@apache.org>
Committed: Tue Nov 8 14:56:18 2016 -0500

----------------------------------------------------------------------
 .../flexjs/TeamPage/src/models/MemberList.as    | 24 +++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72c1e1ff/examples/flexjs/TeamPage/src/models/MemberList.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TeamPage/src/models/MemberList.as b/examples/flexjs/TeamPage/src/models/MemberList.as
index 1b5c3e7..69d2220 100644
--- a/examples/flexjs/TeamPage/src/models/MemberList.as
+++ b/examples/flexjs/TeamPage/src/models/MemberList.as
@@ -35,7 +35,15 @@ package models
 			super(target);
 		}
 
-		public var members:Array = null;
+		private var _members:Array = null;
+		public function get members():Array
+		{
+			return _members;
+		}
+		public function set members(value:Array):void
+		{
+			_members = value;
+		}
 
 		private var app:Application;
 		private var service:HTTPService;
@@ -64,19 +72,29 @@ package models
 		{
 			service.url = "team.json";
 			service.send();
+			service.addEventListener("httpStatus", handleStatusReturn);
 			service.addEventListener("complete", handleLoadComplete);
+			service.addEventListener("ioError", handleError);
+		}
+
+		public function handleStatusReturn(event:org.apache.flex.events.Event):void
+		{
+			// tbd: should handle a bad status here
 		}
 
 		public function handleLoadComplete(event:org.apache.flex.events.Event):void
 		{
 			members = [];
-			trace("We got something back");
-			trace("Collection: "+collection.length+" items");
 			for (var i:int=0; i < collection.length; i++) {
 				var item:Object = collection.getItemAt(i);
 				members.push(item);
 			}
 			dispatchEvent( new Event("membersChanged") );
 		}
+
+		public function handleError(event:org.apache.flex.events.Event):void
+		{
+			// tbd: should handle error here
+		}
 	}
 }


Mime
View raw message