ʹÓÃFabrication+PureMVC¿ª·¢multi modular FlexÓ¦ÓÃ
PureMVCʵÏÖÁ˼òµ¥µÄMVC¿ò¼Ü£¬½«Ó¦Ó÷ÖΪmodel¡¢viewºÍcontrolÈý²¿·Ö¡£
ºÃ´¦ºÜ¶àÁË£¬½µµÍÁËÄ£¿éÖ®¼äµÄñîºÏÐÔ¡¢Ìá¸ßÁ˳ÌÐòµÄ¿Éά»¤ÐԺͿÉÀ©Õ¹ÐÔ¡£
fabricationÔÚPureMVC»ù´¡ÉÏ×öÁËÀ©Õ¹£¬¼ò»¯ÁËpureMVCµÄ¿ª·¢ÄѶȣ¬ÏÂÃæ¼òµ¥½éÉÜÒ»ÏÂfabricationµÄ¿ª·¢¹ý³Ì¡£
Ê×ÏÈ£¬¸ù¾ÝÐèҪʵÏÖorg.puremvc.as3.multicore.utilities.fabrication.components.FlexModule¡¢FlexApplication¡¢FlashApplication»òÕßAirApplication¡£Õâ¾ÍÊÇViewÁË¡£
ÔÚViewÖÐʵÏÖoverride public function getStartupCommand():Class ·½·¨¡£·µ»Ø³õʼ»¯CommandÀ࣬ÈçÏ£º
public class ConfigModuleStartupCommand extends SimpleFabricationCommand {
override public function execute(note:INotification):void {
registerProxy(new GetPropertyProxy());
registerCommand(ShellConstants.USERINFO_FIND, FindUserInfoCommand);
registerMediator(new ConfigModuleMediator(note.getBody() as ConfigModule));
}
}
ÔÚ³õʼ»¯ÀàÖУ¬ÐèҪע²áËùÐèÒªµÄProxy¡¢CommandºÍMediator£¬ProxyÖ÷ÒªÓÃ×÷ºÍºǫ́½øÐн»»¥£¬²éѯºÍÐÞ¸ÄÊý¾Ý£¬Õâ¾ÍÊÇmodelÁË¡£
CommandÓÃ×÷½ÓÊÕViewÖеÄʼþ£¬²¢×ö´¦Àí£¬Ò»°ãÇé¿öϾÍÊǵ÷ÓÃProxyµÄ·½·¨¡£ÈçÏ£º
public class GetPropertyCommand extends SimpleFabricationCommand {
override public function execute(note:INotification):void {
var getPropertyProxy:GetPropertyProxy = retrieveProxy(GetPropertyProxy.NAME) as GetPropertyProxy;
getPropertyProxy.fetchProperty();
}
}
µ±Proxy·½·¨µÃµ½ºǫ́·´À¡ºó£¬»á³ö·¢³É¹¦»òʧ°ÜµÄʼþ¡£ÈçÏ£º
public class GetPropertyProxy extends FabricationProxy
{
static public const NAME:String = "GetPropertyProxy";
private var _remoteService:RemoteObject;
public function GetPropertyProxy(name:String = NAME, data:Object = null)
{
super(name, data);
setup();
}
private function setup():void{
_remoteService = new RemoteObject();
_remoteService.destination = "sysService";
_remoteService.showBusyCursor = true;
_remoteService.addEventListener(ResultEvent.RESULT, result);
_remoteService.addEventListener(FaultEvent.FAULT, failed);
}
p
Ïà¹ØÎĵµ£º
metadata×îÏÈ¿ªÊ¼ÓÚdotnet°É£¬½Ð×öAttribute£»È»ºójavaÒ²½ôËæÆäºó£¬½Ð×öAnnotaion£»actionscriptÔò½Ð×öMetadata¡£ÆäÖÐdotnetÓëActionScriptµÄÓï·¨¸ñʽÉ϶¼ÊÇÏàËÆµÄ£¬ÈçASÖеÄ[Bindable]¡£ÔÚJavaÖÐÔòÊÇÓÃ@XXXÕâÑùµÄÓï·¨£¬Èç@override¡£²»¹ýÄ¿µÄ¶¼ÊÇÒ»¸ö£¬¸øÀà»ò·½·¨»òÊôÐÔÔö¼Ómeta data±ê¼Ç£¬´Ó¶øÊµÏÖ¶ÔÕâЩ±»±ê¼ÇµÄ´úÂë½øÐÐ ......
¹¤³ÌϵÄhistoryÎļþ¼ÐÏ´æ·ÅÈý¸öÎļþ£ºindex.template.html£¬rightClick.js,swfobject.js
srcÎļþ¼ÐÏ´æ·ÅCustomContextMenu.mxmlÎļþ¡£
1.CustomContextMenu.mxml£º
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
applicati ......
±¾Ìùת×Ô£ºhttp://smartblack.javaeye.com/blog/556202
Ò»Ïî¼¼Êõ£¬´Ó¸ÅÄîÌá³öµ½¼¼ÊõÑз¢µ½ÉÌÒµ·¢²¼£¬ÔÙµ½Êµ¼ÊÓ¦Óã¬×îÖÕ½«²úÆ·³ÊÏÖÔÚÓû§ÃæÇ°£¬ÕâÊÇÒ»¸öÂþ³¤¶ø¸´ÔӵĹý³Ì¡£ÔÚÕâµ±ÖУ¬ºÜ¶àÓд´ÒâÓÐÉúÃüÁ¦µÄ¼¼ÊõÒòΪ¸÷ÖÖÔÒòССÒź¶µØ²»ÐÒØ²ÕÛÁË¡£FlexÄÜ×ßµ½½ñÌìȷʵ²»Ò×£¬ÏÂÃæÈÃÎÒÃÇ´Ó²»Í¬µÄ½Ç¶ÈÀ´¿´Ò»ÏÂËüÊÇÈçºÎ¹ý¹ ......
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" creationComplete="initApp()">
<mx:Script>
<![CDATA[
public var pageRecordes:uint = 8;
public var totalPages:ui ......
¹ýÈ¥ÔÚ¶ÔDataGridÉèÖÃÐб³¾°É«Ê±£¬¸Ð¾õ»¹ÊÇͦ·½±ãµÄ£¬Ö»ÒªÖØÐ´DataGridµÄ£¬ÈçÏÂ
private var _rowColorFunction:Function;
public function set rowColorFunction(f:Function):void
{
this._rowColorFunction = f;
}
public function get rowColorFunction():Func ......