flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Updated MobileTrader FlexJS example to be a little more "real world". This version is tested only with ActionScript/browser combination. Uses remote server to obtain stock prices and demonstrates FlexJS mobi
Date Fri, 03 Apr 2015 18:31:21 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop a60374afc -> 7f179c9dd


Updated MobileTrader FlexJS example to be a little more "real world". This version is tested
only with ActionScript/browser combination. Uses remote server to obtain stock prices and
demonstrates FlexJS mobile navigators.


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

Branch: refs/heads/develop
Commit: 7f179c9dd1be5452395e7bd00abf0043ef3da011
Parents: a60374a
Author: Peter Ent <pent@apache.org>
Authored: Fri Apr 3 09:23:09 2015 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Fri Apr 3 09:23:09 2015 -0400

----------------------------------------------------------------------
 examples/MobileTrader/src/MobileTrader.mxml     |   5 +-
 examples/MobileTrader/src/MyInitialView.mxml    |  79 ++++++++-
 .../src/StockDataJSONItemConverter.as           |  40 +++++
 .../src/controller/AlertsViewController.as      | 121 ++++++++++++++
 examples/MobileTrader/src/controller/Feed.as    | 162 -------------------
 .../src/controller/WatchListController.as       | 119 ++++++++++++++
 examples/MobileTrader/src/models/Alert.as       |  76 +++++++++
 examples/MobileTrader/src/models/AssetsModel.as |   0
 .../MobileTrader/src/models/ProductsModel.as    | 131 +++++++++++++--
 examples/MobileTrader/src/models/Stock.as       | 130 +++++++++++++--
 .../MobileTrader/src/renderers/AlertRenderer.as |  44 +++++
 .../MobileTrader/src/renderers/StockRenderer.as |   0
 examples/MobileTrader/src/views/AlertsView.mxml |  66 +++++++-
 examples/MobileTrader/src/views/AssetsView.mxml |   0
 examples/MobileTrader/src/views/SearchView.mxml |   0
 examples/MobileTrader/src/views/StockView.mxml  |  65 +++++++-
 .../MobileTrader/src/views/WatchListView.mxml   |  72 +++++++--
 .../FlexJSJX/src/org/apache/flex/mobile/View.as |  22 ++-
 .../src/org/apache/flex/core/Application.as     |   3 +
 19 files changed, 915 insertions(+), 220 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/MobileTrader.mxml
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/MobileTrader.mxml b/examples/MobileTrader/src/MobileTrader.mxml
old mode 100644
new mode 100755
index cc9a43c..7ef80ce
--- a/examples/MobileTrader/src/MobileTrader.mxml
+++ b/examples/MobileTrader/src/MobileTrader.mxml
@@ -22,15 +22,18 @@
 				   xmlns:local="*"
 				   xmlns:models="models.*"
 				   xmlns:basic="library://ns.apache.org/flexjs/basic" 
+				   xmlns:controller="controller.*" 
 				   >
 	
 	<basic:valuesImpl>
 		<basic:SimpleCSSValuesImpl />
 	</basic:valuesImpl>
+	
 	<basic:model>
 		<models:ProductsModel />
 	</basic:model>
+	
 	<basic:initialView>
-		<local:MyInitialView />
+	   <local:MyInitialView />
 	</basic:initialView>
 </basic:Application>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/MyInitialView.mxml b/examples/MobileTrader/src/MyInitialView.mxml
old mode 100644
new mode 100755
index b50490f..13191fa
--- a/examples/MobileTrader/src/MyInitialView.mxml
+++ b/examples/MobileTrader/src/MyInitialView.mxml
@@ -18,10 +18,13 @@ limitations under the License.
 
 -->
 <basic:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+				xmlns:local="*"
 				xmlns:basic="library://ns.apache.org/flexjs/basic"
 				xmlns:views="views.*" 
 				xmlns:apache="org.apache.flex.html.beads.*"
-				xmlns:html="org.apache.flex.html.*">
+				xmlns:html="org.apache.flex.html.*"
+				xmlns:controller="controller.*"
+				initComplete="onInitComplete()" xmlns:models="models.*" >
 	
 	
 	
@@ -87,6 +90,23 @@ limitations under the License.
 		views|WatchListView {
 			width: 480px;
 			height: 640px;
+			IBeadController:ClassReference('controller.WatchListController');
+		}
+		
+		.WatchListInner {
+			height: 480px;
+			width:  480px;
+		}
+		
+		.WatchListDataGrid {
+			height: 480px;
+			width:  480px;
+		}
+		
+		.WatchListInputArea {
+			background-color: #FFFFFF;
+			padding: 10px;
+			width: 480px;
 		}
 		
 		views|StockView {
@@ -97,6 +117,7 @@ limitations under the License.
 		views|AlertsView {
 			width: 480px;
 			height: 640px;
+			IBeadController:ClassReference('controller.AlertsViewController');
 		}
 		
 		.redCell {
@@ -107,6 +128,47 @@ limitations under the License.
 			color: #00FF00;
 		}
 		
+		.ViewTitle {
+			font-size: 18pt;
+			font-weight: bold;
+			padding: 10pt;
+		}
+		
+		.StockName {
+			font-size: 14pt;
+			font-weight: normal;
+			padding: 10pt;
+		}
+		
+		.StockDetailArea {
+			padding: 10pt;
+		}
+		
+		.StockLabel {
+			font-size: 18pt;
+			font-weight: normal;
+			color: #2255DD;
+		}
+		
+		.StockRemoveButton {
+			background-color: #FF5522;
+			font-size: 16pt;
+			font-weight: bold;
+			color: #FFFFFF;
+			width: 200px;
+			height: 50px;
+		}
+		
+		.StockRemoveButton:hover {
+			background-color: #DD3300;
+		}
+		
+		.StockValue {
+			font-size: 18pt;
+			font-weight: normal;
+			color: #999999;
+		}
+		
 		@media -flex-flash
 		{
 			.NavigationBar {
@@ -118,11 +180,24 @@ limitations under the License.
 	
 	<fx:Script>
 		<![CDATA[
+			import org.apache.flex.core.IBeadController;
+			import org.apache.flex.core.IBeadModel;
 			import org.apache.flex.events.Event;
 			import org.apache.flex.mobile.IView;
 			import org.apache.flex.mobile.IViewManager;
 			import org.apache.flex.mobile.chrome.NavigationBar;
 			
+			private function onInitComplete():void
+			{
+				// Give the model to the WatchListView's dataModel; do not replace
+				// a component's model with a custom model as that can adversely
+				// affect a component's behavior.
+				watchListView.dataModel = applicationModel as IBeadModel;
+				
+				alertsView.dataModel = applicationModel as IBeadModel;
+				trace("alerts view set");
+			}
+			
 			private function onAssetsNext():void
 			{
 				
@@ -170,7 +245,7 @@ limitations under the License.
 			
 			<basic:StackedViewManager id="watchListStack" title="Watch List" viewChanged="watchListStackChanged(event)">
 				<basic:views>
-					<views:WatchListView id="watchListView" />
+					<views:WatchListView id="watchListView"/>
 				</basic:views>
 			</basic:StackedViewManager>
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/StockDataJSONItemConverter.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/StockDataJSONItemConverter.as b/examples/MobileTrader/src/StockDataJSONItemConverter.as
new file mode 100755
index 0000000..6640bd5
--- /dev/null
+++ b/examples/MobileTrader/src/StockDataJSONItemConverter.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{    
+    import org.apache.flex.net.JSONItemConverter;
+    
+    public class StockDataJSONItemConverter extends JSONItemConverter
+    {
+        public function StockDataJSONItemConverter()
+        {
+            super();
+        }
+        
+        override public function convertItem(data:String):Object
+        {
+            var obj:Object = super.convertItem(data);
+			if (obj["query"]["count"] == 0)
+				return "No Data";
+			
+			obj = obj["query"]["results"]["quote"];
+			return obj;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/controller/AlertsViewController.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/controller/AlertsViewController.as b/examples/MobileTrader/src/controller/AlertsViewController.as
new file mode 100644
index 0000000..dc41591
--- /dev/null
+++ b/examples/MobileTrader/src/controller/AlertsViewController.as
@@ -0,0 +1,121 @@
+package controller
+{
+	import models.Alert;
+	import models.ProductsModel;
+	import models.Stock;
+	
+	import org.apache.flex.core.IBeadController;
+	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.utils.Timer;
+	
+	import views.AlertsView;
+	
+	public class AlertsViewController extends EventDispatcher implements IBeadController
+	{
+		public function AlertsViewController()
+		{
+			super();
+			
+			timer = new Timer(updateInterval, 0);
+			timer.addEventListener("timer", timerHandler);
+		}
+		
+		public var updateInterval:Number = 5000;
+		
+		protected var timer:Timer;
+			
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+			var view:AlertsView = value as AlertsView;
+			view.addEventListener("alertSet", handleAlertSet);
+		}
+		
+		private var _model:IBeadModel;
+		public function set model(value:IBeadModel):void
+		{
+			_model = value;
+		}
+		public function get model():IBeadModel
+		{
+			return _model;
+		}
+		
+		private function handleAlertSet(event:Event):void
+		{
+			var view:AlertsView = _strand as AlertsView;
+			
+			var sym:String = view.symbolField.text.toUpperCase();
+			var value:Number = Number(view.valueField.text);
+			
+			var alert:Alert = new Alert();
+			alert.symbol = sym;
+			alert.value = value;
+			alert.greaterThan = view.higherCheck.selected;
+			
+			// add this stock to the watch list in case it isn't there already
+			alert.stock = (model as ProductsModel).addStock(sym);
+			
+			// set up the alert for the stock
+			(model as ProductsModel).addAlert(alert);
+			
+			view.symbolField.text = "";
+			view.valueField.text = "";
+			
+			subscribe();
+		}
+		
+		public function subscribe():void
+		{
+			if (!timer.running) 
+			{
+				timer.start();
+			}
+		}
+		
+		public function unsubscribe():void
+		{
+			if (timer.running) 
+			{
+				timer.stop();
+			}
+		}
+		
+		/**
+		 * When the timer goes off, verify all of the alerts against each stocks' last
+		 * price.
+		 */
+		protected function timerHandler(event:*):void
+		{
+			var alerts:Array = (model as ProductsModel).alerts;
+			
+			if (alerts.length == 0) return;
+			
+			for (var i:int=0; i < alerts.length; i++)
+			{
+				var alert:Alert = alerts[i] as Alert;
+				alert.message = "";
+				
+				if (alert.greaterThan) {
+					if (alert.stock.last >= alert.value) {
+						alert.message = "Now @"+alert.stock.last;
+					}
+				}
+				else {
+					if (alert.stock.last <= alert.value) {
+						alert.message = "Now @"+alert.stock.last;
+					}
+				}
+			}
+			
+			var newEvent:Event = new Event("alertsUpdate");
+			model.dispatchEvent(newEvent);
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/controller/Feed.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/controller/Feed.as b/examples/MobileTrader/src/controller/Feed.as
deleted file mode 100755
index 043f31a..0000000
--- a/examples/MobileTrader/src/controller/Feed.as
+++ /dev/null
@@ -1,162 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////s
-package controller
-{
-//	import flash.events.TimerEvent;
-	
-	import models.Stock;
-	
-	import org.apache.flex.core.IBeadModel;
-	import org.apache.flex.core.IStrand;
-	import org.apache.flex.events.Event;
-	import org.apache.flex.events.EventDispatcher;
-	import org.apache.flex.utils.Timer;
-	
-	[Event("change",org.apache.flex.events.Event)]
-
-	public class Feed extends EventDispatcher implements IBeadModel
-	{
-		protected var index:int = 0;
-		
-		protected var updateOrder:Array = [6,4,1,7,0,3,2,5]; // used to simulated randomness of
updates
-		
-		protected var timer:Timer;
-		
-		protected var stockMap:Object;
-		
-		private var _stockList:Array;
-		public function get stockList():Array
-		{
-			return _stockList;
-		}
-		public function set stockList(value:Array):void
-		{
-			_stockList = value;
-		}
-		
-		public function set strand(value:IStrand):void
-		{
-			// not used
-		}
-		
-		public function Feed()
-		{
-			stockMap = new Object();
-			stockList = new Array();
-			
-			stockList.push(new Stock("XOM", 81.39));
-			stockList.push(new Stock("WMT", 51.47));
-			stockList.push(new Stock("CVX", 102.93));
-			stockList.push(new Stock("AIG", 36.01));
-			stockList.push(new Stock("IBM", 155.49));
-			stockList.push(new Stock("SAP", 57.53));
-			stockList.push(new Stock("MOT", 41.50));
-			stockList.push(new Stock("MCD", 73));
-			
-			var stockCount:int = stockList.length;
-			
-			for (var k:int = 0; k < stockCount; k++)
-			{
-				var s:Stock = stockList[k] as Stock;
-				s.open = s.last;
-				s.high = s.last;
-				s.low = s.last;
-				s.change = 0;
-				stockMap[s.symbol] = s;
-			}
-			
-			// Simulate history for the last 2 minutes			
-			for (var i:int=0; i < 120 ; i++)
-			{
-				for (var j:int=0 ; j<stockCount ; j++)
-				{
-					simulateChange(stockList[j] as Stock, false);
-				}
-			}		
-			timer = new Timer(1000 / 4, 0);
-			timer.addEventListener("timer", timerHandler);
-		}
-		
-		public function subscribe():void
-		{
-			if (!timer.running) 
-			{
-				timer.start();
-			}
-		}
-		
-		public function unsubscribe():void
-		{
-			if (timer.running) 
-			{
-				timer.stop();
-			}
-		}
-
-		protected function timerHandler(event:*):void
-		{
-			if (index >= stockList.length) index = 0;
-			simulateChange(stockList[updateOrder[index]] as Stock, true);
-			index++;
-			
-			var newEvent:Event = new Event("update");
-			this.dispatchEvent(newEvent);
-		}
-		
-		protected function simulateChange(stock:Stock, removeFirst:Boolean = true):void
-		{
-			var maxChange:Number = stock.open * 0.005;
-			var change:Number = maxChange - Math.random() * maxChange * 2;
-			
-			change = change == 0 ? 0.01 : change;
-			
-			var newValue:Number = stock.last + change;
-			
-			if (newValue > stock.open * 1.15 || newValue < stock.open * 0.85)
-			{
-				change = -change;
-				newValue = stock.last + change;
-			}
-			
-			stock.change = change;
-			stock.last = newValue;
-			
-			if (stock.last > stock.high)
-			{
-				stock.high = stock.last;
-			}
-			else if (stock.last < stock.low || stock.low == 0)
-			{
-				stock.low = stock.last;
-			}
-			
-			if (!stock.history)
-			{
-				stock.history = new Array();
-			}
-			if (removeFirst)
-			{
-				stock.history.splice(1,0);
-			}
-			stock.history.push({high: stock.high, low: stock.low, open: stock.open, last: stock.last});
-
-		}
-		
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/controller/WatchListController.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/controller/WatchListController.as b/examples/MobileTrader/src/controller/WatchListController.as
new file mode 100644
index 0000000..115d23f
--- /dev/null
+++ b/examples/MobileTrader/src/controller/WatchListController.as
@@ -0,0 +1,119 @@
+package controller
+{
+	import models.ProductsModel;
+	import models.Stock;
+	
+	import org.apache.flex.core.IBeadController;
+	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.utils.Timer;
+	
+	import views.StockView;
+	import views.WatchListView;
+	
+	public class WatchListController extends EventDispatcher implements IBeadController
+	{
+		public function WatchListController()
+		{
+			super();
+			
+			timer = new Timer(updateInterval, 0);
+			timer.addEventListener("timer", timerHandler);
+		}
+		
+		public var updateInterval:Number = 5000;
+		
+		protected var timer:Timer;
+		
+		private var index:Number = 0;
+		private var selectedStock:Stock;
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+			var view:WatchListView = value as WatchListView;
+			view.addEventListener("addSymbol", handleAddSymbol);
+			view.addEventListener("stockSelected", handleGridSelection);
+		}
+		
+		private var _model:IBeadModel;
+		public function set model(value:IBeadModel):void
+		{
+			_model = value;
+		}
+		public function get model():IBeadModel
+		{
+			return _model;
+		}
+		
+		private function handleAddSymbol(event:Event):void
+		{
+			var view:WatchListView = _strand as WatchListView;
+			var symbol:String = view.symbolName.text.toUpperCase();
+			
+			view.symbolName.text = "";
+			
+			(model as ProductsModel).addStock(symbol);
+			
+			subscribe();
+		}
+		
+		private function handleGridSelection(event:Event):void
+		{
+			var view:WatchListView = _strand as WatchListView;
+			selectedStock = (model as ProductsModel).watchList[view.selectedStockIndex] as Stock;
+			trace("Selected stock "+selectedStock.symbol);
+			
+			var stockView:StockView = view.showStockDetails(selectedStock);
+			stockView.addEventListener("removeFromList", handleRemoveFromList);
+		}
+		
+		public function handleRemoveFromList(event:Event):void
+		{
+			(model as ProductsModel).removeStock(selectedStock);
+			
+			var view:WatchListView = _strand as WatchListView;
+			view.popView();
+		}
+		
+		public function subscribe():void
+		{
+			if (!timer.running) 
+			{
+				timer.start();
+			}
+		}
+		
+		public function unsubscribe():void
+		{
+			if (timer.running) 
+			{
+				timer.stop();
+			}
+		}
+		
+		/**
+		 * Each time the handler goes off a different stock in the list
+		 * is updated. This keeps the app from sending too many requests
+		 * all at once.
+		 */
+		protected function timerHandler(event:*):void
+		{
+			var stockList:Array = (model as ProductsModel).watchList;
+			
+			if (stockList.length == 0) return;
+			
+			if (index >= stockList.length) index = 0;
+			
+			(model as ProductsModel).updateStockData(stockList[index] as Stock);
+			index++;
+			
+			var newEvent:Event = new Event("update");
+			model.dispatchEvent(newEvent);
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/models/Alert.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/models/Alert.as b/examples/MobileTrader/src/models/Alert.as
new file mode 100644
index 0000000..56fbd82
--- /dev/null
+++ b/examples/MobileTrader/src/models/Alert.as
@@ -0,0 +1,76 @@
+package models
+{
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+
+	public class Alert extends EventDispatcher
+	{
+		public function Alert()
+		{
+			super();
+			message = "";
+		}
+		
+		private var _symbol:String;
+		private var _value:Number;
+		private var _greaterThan:Boolean;
+		private var _message:String;
+		private var _stock:Stock;
+		
+		[Binding("symbolChanged")]
+		public function get symbol():String
+		{
+			return _symbol;
+		}
+		public function set symbol(value:String):void
+		{
+			_symbol = value;
+			dispatchEvent(new Event("symbolChanged"));
+		}
+		
+		[Binding("messageChanged")]
+		public function get message():String
+		{
+			return _message;
+		}
+		public function set message(value:String):void
+		{
+			_message = value;
+			dispatchEvent(new Event("messageChanged"));
+		}
+		
+		[Binding("valueChanged")]
+		public function get value():Number
+		{
+			return _value;
+		}
+		public function set value(newValue:Number):void
+		{
+			_value = newValue;
+			dispatchEvent(new Event("valueChanged"));
+		}
+		
+		[Binding("greaterThanChanged")]
+		public function get greaterThan():Boolean
+		{
+			return _greaterThan;
+		}
+		public function set greaterThan(value:Boolean):void
+		{
+			_greaterThan = value;
+			dispatchEvent(new Event("greaterThanChanged"));
+		}
+		
+		[Binding("stockChanged")]
+		public function get stock():Stock
+		{
+			return _stock;
+		}
+		public function set stock(value:Stock):void
+		{
+			_stock = value;
+			dispatchEvent(new Event("stockChanged"));
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/models/AssetsModel.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/models/AssetsModel.as b/examples/MobileTrader/src/models/AssetsModel.as
old mode 100644
new mode 100755

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/models/ProductsModel.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/models/ProductsModel.as b/examples/MobileTrader/src/models/ProductsModel.as
old mode 100644
new mode 100755
index dd1cf2e..553f091
--- a/examples/MobileTrader/src/models/ProductsModel.as
+++ b/examples/MobileTrader/src/models/ProductsModel.as
@@ -18,12 +18,38 @@
 ////////////////////////////////////////////////////////////////////////////////
 package models
 {
+	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
 	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.net.HTTPService;
+	import org.apache.flex.net.JSONInputParser;
+	import org.apache.flex.net.dataConverters.LazyCollection;
 		
-	public class ProductsModel extends EventDispatcher
+	public class ProductsModel extends EventDispatcher implements IBeadModel
 	{
 		public function ProductsModel()
 		{
+			super();
+			
+			service = new HTTPService();
+			collection = new LazyCollection;
+			collection.inputParser = new JSONInputParser();
+			collection.itemConverter = new StockDataJSONItemConverter();
+		}
+		
+		private var service:HTTPService;
+		private var collection:LazyCollection;
+		private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
+		private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
+		
+		private var _strand:IStrand;
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+			service.addBead(collection);
+			_strand.addBead(service);
 		}
 
 		private var _tabList:Array = ["Assets", "Watch", "Alerts"];
@@ -31,21 +57,104 @@ package models
 		{
 			return _tabList;
 		}
-		
-		private var _stockData:Array = [
-			{stock:"XOM",  open:81.39,   last:86.22,  high:88.40,  low:81.30,  image:""},
-			{stock:"WMT",  open:51.47,   last:52.00,  high:52.50,  low:51.04,  image:""},
-			{stock:"CVX",  open:102.93,  last:104.13, high:104.41, low:101.15, image:""}
-		];
-		public function get stockData():Array
-		{
-			return _stockData;
-		}
 
 		private var _labelFields:Array = [ "id", "title", "detail" ];
 		public function get labelFields():Array
 		{
 			return _labelFields;
 		}
+		
+		private var _watchList:Array = [];
+		
+		public function get watchList():Array
+		{
+			return _watchList;
+		}
+		
+		private var _alerts:Array = [];
+		
+		public function get alerts():Array
+		{
+			return _alerts;
+		}
+		
+		public function addAlert(value:Alert):void
+		{
+			for (var i:int =0; i < _alerts.length; i++)
+			{
+				var alert:Alert = _alerts[i] as Alert;
+				if (alert.symbol == value.symbol) {
+					_alerts[i] = value;
+					return;
+				}
+			}
+			
+			_alerts.push(value);
+			dispatchEvent(new Event("alertsUpdate"));
+		}
+		
+		public function addStock(symbol:String):Stock
+		{
+			for (var i:int=0; i < _watchList.length; i++)
+			{
+				var stock:Stock = _watchList[i];
+				if (stock.symbol == symbol) return stock;
+			}
+			
+			stock = new Stock(symbol);
+			
+			_watchList.push(stock);
+			dispatchEvent(new Event("update"));
+			
+			updateStockData(stock);
+			return stock;
+		}
+		
+		public function updateStockData(value:Stock):void
+		{
+			var sym:String = value.symbol;
+			service.url = queryBegin + sym + queryEnd;
+			service.send();
+			service.addEventListener("complete", completeHandler);
+		}
+		
+		public function removeStock(stock:Stock):void
+		{
+			for (var i:int=0; i < alerts.length; i++)
+			{
+				var alert:Alert = alerts[i] as Alert;
+				if (stock.symbol == alert.symbol) {
+					alerts.splice(i,1);
+					break;
+				}
+			}
+			
+			for (i=0; i < _watchList.length; i++)
+			{
+				var s:Stock = _watchList[i] as Stock;
+				if (stock.symbol == s.symbol) {
+					_watchList.splice(i,1);
+					break;
+				}
+			}
+			
+			dispatchEvent(new Event("alertsUpdate"));
+			dispatchEvent(new Event("update"));
+		}
+		
+		private function completeHandler(event:Event):void
+		{
+			var responseData:Object = collection.getItemAt(0);
+			
+			var sym:String = responseData["Symbol"];
+			for (var i:int=0; i < _watchList.length; i++)
+			{
+				var stock:Stock = _watchList[i];
+				if (stock.symbol == sym) {
+					stock.updateFromData(responseData);
+					break;
+				}
+			}
+		}
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/models/Stock.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/models/Stock.as b/examples/MobileTrader/src/models/Stock.as
index 49e63d2..9e53f47 100755
--- a/examples/MobileTrader/src/models/Stock.as
+++ b/examples/MobileTrader/src/models/Stock.as
@@ -18,25 +18,131 @@
 ////////////////////////////////////////////////////////////////////////////////
 package models
 {
-	public class Stock
-	{	    
-		public var symbol:String;
-		public var name:String;
-		public var low:Number;
-		public var high:Number;
-		public var open:Number;
-		public var last:Number;
-		public var change:Number = 0;
-		public var date:Date;
-		
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	
+	public class Stock extends EventDispatcher
+	{	    		
 		public var history:Array;
 		
-		public function Stock(symbol:String, last:Number)
+		public function Stock(symbol:String=null, last:Number=0)
 		{
 			this.symbol = symbol;
 			this.last = last;
+			this.low = last;
+			this.high = last;
+			this.open = last;
+			this.change = 0;
+			this.name = "";
+		}
+		
+		public function updateFromData(obj:Object):void
+		{
+			name = obj["Name"];
+			low = obj["DaysLow"];
+			high = obj["DaysHigh"];
+			open = obj["Open"];
+			change = obj["Change"];
+			symbol = obj["Symbol"];
+			last = obj["LastTradePriceOnly"];
+		}
+		
+		private var _symbol:String;
+		private var _name:String;
+		private var _low:Number;
+		private var _high:Number;
+		private var _open:Number;
+		private var _last:Number;
+		private var _change:Number;
+		private var _date:Date;
+		
+		[Bindable("symbolChanged")]
+		public function get symbol():String
+		{
+			return _symbol;
+		}
+		public function set symbol(value:String):void
+		{
+			_symbol = value;
+			dispatchEvent(new Event("symbolChanged"));
 		}
 		
+		[Bindable("nameChanged")]
+		public function get name():String
+		{
+			return _name;
+		}
+		public function set name(value:String):void
+		{
+			_name = value;
+			dispatchEvent(new Event("nameChanged"));
+		}
+		
+		[Bindable("lowChanged")]
+		public function get low():Number
+		{
+			return _low;
+		}
+		public function set low(value:Number):void
+		{
+			_low = value;
+			dispatchEvent(new Event("lowChanged"));
+		}
+		
+		[Bindable("highChanged")]
+		public function get high():Number
+		{
+			return _high;
+		}
+		public function set high(value:Number):void
+		{
+			_high = value;
+			dispatchEvent(new Event("highChanged"));
+		}
+		
+		[Bindable("openChanged")]
+		public function get open():Number
+		{
+			return _open;
+		}
+		public function set open(value:Number):void
+		{
+			_open = value;
+			dispatchEvent(new Event("openChanged"));
+		}
+		
+		[Bindable("lastChanged")]
+		public function get last():Number
+		{
+			return _last;
+		}
+		public function set last(value:Number):void
+		{
+			_last = value;
+			dispatchEvent(new Event("lastChanged"));
+		}
+		
+		[Bindable("changeChanged")]
+		public function get change():Number
+		{
+			return _change;
+		}
+		public function set change(value:Number):void
+		{
+			_change = value;
+			dispatchEvent(new Event("changeChanged"));
+		}
+		
+		[Bindable("dateChanged")]
+		public function get date():Date
+		{
+			return _date;
+		}
+		public function set date(value:Date):void
+		{
+			_date = value;
+			dispatchEvent(new Event("dateChanged"));
+		}
 	}
 	
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/renderers/AlertRenderer.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/renderers/AlertRenderer.as b/examples/MobileTrader/src/renderers/AlertRenderer.as
new file mode 100644
index 0000000..e683020
--- /dev/null
+++ b/examples/MobileTrader/src/renderers/AlertRenderer.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package renderers
+{
+	import org.apache.flex.html.supportClasses.StringItemRenderer;
+	
+	public class AlertRenderer extends StringItemRenderer
+	{
+		public function AlertRenderer()
+		{
+			super();
+		}
+		
+		override public function set data(value:Object):void
+		{
+			super.data = value;
+			
+			if (labelField == "greaterThan") {
+				if (Boolean(value[labelField])) {
+					text = "when over "+value["value"];
+				}
+				else {
+					text = "when under "+value["value"];
+				}
+			}
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/renderers/StockRenderer.as
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/renderers/StockRenderer.as b/examples/MobileTrader/src/renderers/StockRenderer.as
old mode 100644
new mode 100755

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/views/AlertsView.mxml
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/views/AlertsView.mxml b/examples/MobileTrader/src/views/AlertsView.mxml
old mode 100644
new mode 100755
index 996fbd9..91b3c0e
--- a/examples/MobileTrader/src/views/AlertsView.mxml
+++ b/examples/MobileTrader/src/views/AlertsView.mxml
@@ -21,7 +21,7 @@ limitations under the License.
 			 title="Alerts"
 				       xmlns:basic="library://ns.apache.org/flexjs/basic"
 				       xmlns:local="*"
-				       className="AlertsView">
+				       className="AlertsView" xmlns:renderers="renderers.*">
 	
 	<fx:Metadata>
 		[Event("next")]
@@ -29,16 +29,70 @@ limitations under the License.
 	
 	<fx:Script>
 		<![CDATA[
+			import controller.AlertsViewController;
+						
+			import org.apache.flex.core.IBeadModel;
 			import org.apache.flex.events.Event;
-			private function gotoNext():void
+			
+			public function set dataModel(value:IBeadModel):void
+			{				
+				(controller as AlertsViewController).model = value;
+			}
+			public function get dataModel():IBeadModel
+			{
+				return (controller as AlertsViewController).model;
+			}
+			
+			private function onAlertSet():void
 			{
-				trace("goto next");
-				dispatchEvent(new org.apache.flex.events.Event("next"));
+				dispatchEvent(new org.apache.flex.events.Event("alertSet"));
 			}
 		]]>
 	</fx:Script>
+		
+	<basic:Container x="4" y="10" >
+		<basic:beads>
+			<basic:NonVirtualHorizontalLayout />
+		</basic:beads>
+		<basic:Label text="Symbol:" />
+		<basic:TextInput id="symbolField" />
+		<basic:Label text="Value:" />
+		<basic:TextInput id="valueField" />
+		<basic:CheckBox text="Higher?" id="higherCheck" />
+		<basic:TextButton text="Set" click="onAlertSet()" />
+	</basic:Container>
 	
-	<basic:Label text="Alerts View" x="20" y="100" />
-	<basic:TextButton text="Next" x="20" y="150" click="gotoNext()" />
+	<basic:DataGrid x="0" y="40" width="480" height="200">
+		<basic:beads>
+			<basic:SimpleBinding
+				eventName="alertAdded"
+				sourceID="dataModel"
+				sourcePropertyName="alerts"
+				destinationPropertyName="dataProvider" />
+		</basic:beads>
+		<basic:columns>
+			<basic:DataGridColumn label="Symbol" dataField="symbol">
+				<basic:itemRenderer>
+					<fx:Component>
+						<basic:StringItemRenderer />
+					</fx:Component>
+				</basic:itemRenderer>
+			</basic:DataGridColumn>
+			<basic:DataGridColumn label="Alert" dataField="greaterThan">
+				<basic:itemRenderer>
+					<fx:Component>
+						<renderers:AlertRenderer />
+					</fx:Component>
+				</basic:itemRenderer>
+			</basic:DataGridColumn>
+			<basic:DataGridColumn label="Message" dataField="message">
+				<basic:itemRenderer>
+					<fx:Component>
+						<basic:StringItemRenderer />
+					</fx:Component>
+				</basic:itemRenderer>
+			</basic:DataGridColumn>
+		</basic:columns>
+	</basic:DataGrid>
 	
 </basic:View>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/views/AssetsView.mxml
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/views/AssetsView.mxml b/examples/MobileTrader/src/views/AssetsView.mxml
old mode 100644
new mode 100755

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/views/SearchView.mxml
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/views/SearchView.mxml b/examples/MobileTrader/src/views/SearchView.mxml
old mode 100644
new mode 100755

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/views/StockView.mxml
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/views/StockView.mxml b/examples/MobileTrader/src/views/StockView.mxml
old mode 100644
new mode 100755
index 9f9792b..31ff256
--- a/examples/MobileTrader/src/views/StockView.mxml
+++ b/examples/MobileTrader/src/views/StockView.mxml
@@ -25,20 +25,75 @@ limitations under the License.
 	
 	<fx:Script>
 		<![CDATA[			
+			import models.Stock;
+			
+			import org.apache.flex.events.Event;
 			import org.apache.flex.mobile.StackedViewManager;
+			
+			private var _stock:Stock;
+			
+			[Bindable("stockChanged")]
+			public function get stock():Stock
+			{
+				return _stock;
+			}
+			public function set stock(value:Stock):void
+			{
+				_stock = value;
+				dispatchEvent(new org.apache.flex.events.Event("stockChanged"));
+			}
+			
 			private function onBackClick() : void
 			{
 				(viewManager as StackedViewManager).pop();
 			}
 			
-			private function onNextClick() : void
+			override public function addedToParent():void
 			{
-				var nextView:SearchView = new SearchView();
-				(viewManager as StackedViewManager).push(nextView);
+				super.addedToParent();
+				
+				stockSymbol.text = stock.symbol;
+				stockName.text = stock.name;
+				lastPrice.text = String(stock.last);
+				openPrice.text = String(stock.open);
+				lowPrice.text = String(stock.low);
+				highPrice.text = String(stock.high);
+				changeAmount.text = String(stock.change);
+			}
+			
+			private function removeFromList():void
+			{
+				dispatchEvent(new org.apache.flex.events.Event("removeFromList"));
 			}
 		]]>
 	</fx:Script>
+	
+	<basic:Container>
+		<basic:beads>
+			<basic:NonVirtualVerticalLayout />
+			<basic:ViewBaseDataBinding />
+		</basic:beads>
+		<basic:style>
+			<basic:SimpleCSSStyles top="10px" left="10px" />
+		</basic:style>
+		
+		<basic:Label id="stockSymbol" text="{stock.symbol}" className="ViewTitle" />
+		<basic:Label id="stockName" text="{stock.name}" className="StockName"  />
+		
+		<basic:Container className="StockDetailArea">
+			<basic:beads>
+				<basic:VerticalColumnLayout numColumns="2" />
+			</basic:beads>
+			
+			<basic:Label text="Last Price:" className="StockLabel" /> <basic:Label id="lastPrice"
className="StockValue" />
+			<basic:Label text="Open Price:" className="StockLabel" /> <basic:Label id="openPrice"
className="StockValue" />
+			<basic:Label text="Low  Price:" className="StockLabel" /> <basic:Label id="lowPrice"
className="StockValue" />
+			<basic:Label text="High Price:" className="StockLabel" /> <basic:Label id="highPrice"
className="StockValue" />
+			<basic:Label text="Change:    " className="StockLabel" /> <basic:Label id="changeAmount"
className="StockValue" />
+		</basic:Container>
 		
-	<basic:Label text="Stock View" x="20" y="100" />
-	<basic:TextButton text="Again" x="20" y="130" click="onNextClick()" />
+		<basic:Container className="StockDetailArea">
+			<basic:TextButton text="Remove From List" width="200" className="StockRemoveButton"
click="removeFromList()" />
+		</basic:Container>
+	</basic:Container>
 </basic:View>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/examples/MobileTrader/src/views/WatchListView.mxml
----------------------------------------------------------------------
diff --git a/examples/MobileTrader/src/views/WatchListView.mxml b/examples/MobileTrader/src/views/WatchListView.mxml
old mode 100644
new mode 100755
index 5243ca8..b10b987
--- a/examples/MobileTrader/src/views/WatchListView.mxml
+++ b/examples/MobileTrader/src/views/WatchListView.mxml
@@ -27,10 +27,27 @@ limitations under the License.
 	
 	<fx:Script>
 		<![CDATA[						
+			import controller.WatchListController;
+			
+			import models.ProductsModel;
+			import models.Stock;
+			
+			import org.apache.flex.binding.SimpleBinding;
+			import org.apache.flex.core.IBeadController;
+			import org.apache.flex.core.IBeadModel;
 			import org.apache.flex.events.Event;
 			import org.apache.flex.mobile.IViewManager;
 			import org.apache.flex.mobile.StackedViewManager;
-
+						
+			public function set dataModel(value:IBeadModel):void
+			{
+				(controller as WatchListController).model = value;
+			}
+			public function get dataModel():IBeadModel
+			{
+				return (controller as WatchListController).model;
+			}
+			
 			private function onSelectStock():void
 			{
 				var stockView:StockView = new StockView();
@@ -38,37 +55,60 @@ limitations under the License.
 				(viewManager as StackedViewManager).push(stockView);
 			}
 			
-			private function onStockChange(event:org.apache.flex.events.Event):void
+			private function addSymbol():void
 			{
-				
+				dispatchEvent(new org.apache.flex.events.Event("addSymbol"));
+			}
+			
+			public var selectedStockIndex:Number;
+			
+			private function selectRow():void
+			{
+				selectedStockIndex = dataGrid.selectedIndex;
+				dispatchEvent(new org.apache.flex.events.Event("stockSelected"));
 			}
 			
-			override public function addedToParent():void
+			public function showStockDetails(stock:Stock):StockView
 			{
-				super.addedToParent();
+				var stockView:StockView = new StockView();
+				stockView.stock = stock;
+				(viewManager as StackedViewManager).push(stockView);
 				
-				var feed:Feed = this.model as Feed;
-				feed.addEventListener("update",onStockChange);
-				feed.subscribe();
+				return stockView;
+			}
+			
+			public function popView():void
+			{
+				(viewManager as StackedViewManager).pop();
 			}
 		]]>
 	</fx:Script>
 	
-	<basic:model>
-		<controller:Feed />
-	</basic:model>
+	<basic:beads>
+		<basic:NonVirtualVerticalLayout />
+	</basic:beads>
+	
+	<basic:Container className="WatchListInputArea">
+		<basic:beads>
+			<basic:NonVirtualHorizontalLayout />
+		</basic:beads>
+		<basic:Label text="Symbol:" />
+		<basic:TextInput id="symbolName" />
+		<basic:TextButton text="Add" click="addSymbol()" />
+	</basic:Container>
 	
-	<basic:Container x="0" y="0" width="480" className="WatchListInner">
+	<basic:Container x="0" y="0" className="WatchListInner">
 		<basic:beads>
-			<basic:NonVirtualVerticalLayout />
+			<basic:ScrollingContainerView />
+			<basic:NonVirtualVerticalScrollingLayout />
 		</basic:beads>
 		
-		<basic:DataGrid width="480" height="380" change="onSelectStock()">
+		<basic:DataGrid id="dataGrid" change="selectRow()" width="480" height="480" className="WatchListDataGrid">
 			<basic:beads>
 				<basic:SimpleBinding
 					eventName="update"
-					sourceID="model"
-					sourcePropertyName="stockList"
+					sourceID="dataModel"
+					sourcePropertyName="watchList"
 					destinationPropertyName="dataProvider" />
 			</basic:beads>
 			<basic:columns>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/frameworks/as/projects/FlexJSJX/src/org/apache/flex/mobile/View.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/mobile/View.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/mobile/View.as
index 6b355f1..456116f 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/mobile/View.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/mobile/View.as
@@ -18,7 +18,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mobile
 {
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IBeadController;
 	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.html.Container;
 	
 	/**
@@ -57,12 +60,21 @@ package org.apache.flex.mobile
 			_viewManager = value;
 		}
 		
-		override public function addedToParent():void
+		private var _controller:IBeadController;
+		public function get controller():IBeadController
 		{
-			super.addedToParent();
-//			this.width = this.viewManager.contentWidth;
-//			this.height = this.viewManager.contentHeight;
-//			trace("Set View to "+this.width+"x"+this.height);
+			if (_controller == null) {
+				_controller = getBeadByType(IBeadController) as IBeadController;
+				if (_controller == null) {
+					_controller = new (ValuesManager.valuesImpl.getValue(this, "iBeadController")) as IBeadController;
+					addBead(_controller);
+				}
+			}
+			return _controller;
+		}
+		public function set controller(value:IBeadController):void
+		{
+			_controller = value;
 		}
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7f179c9d/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
index 9b9506e..0bc16b7 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
@@ -125,6 +125,9 @@ package org.apache.flex.core
         
         private function initHandler(event:flash.events.Event):void
         {
+			if (model) addBead(model as IBead);
+			if (controller) addBead(controller as IBead);
+			
             MouseEventConverter.setupAllConverters(stage);
                 
             for each (var bead:IBead in beads)


Mime
View raw message