|
|
Show Posts
|
Pages: [1]
|
2
|
Announcements and General Discussion / Getting Started / Native window and PureMVC
|
on: August 14, 2009, 05:46:35
|
I make NativeWindow component (based on script from TourDeFlex application). But I don't know how to implement PureMVC on native component. Is there any code sample, or can somebody show some simple viewComponent-mediator example. Just how to catch event from button from native component.
Thanks
|
|
|
3
|
Announcements and General Discussion / Getting Started / App update and PureMVC - urgent
|
on: August 14, 2009, 02:34:02
|
Hi,
I need to add update functionlity. I have everything ready but I put my first call to update method in startup command like this: sendNotification(UpdaterCommand.UPDATE); this should open update popup (if there is update) and rest is up to user. Problem... I receive bunch of errors and my view component and mediator are not connected properly.
Where is the best place to put call to update command?
|
|
|
4
|
Announcements and General Discussion / Getting Started / StartupCommand can't see view component
|
on: July 09, 2009, 07:50:00
|
Sometime happens that I try to register new component (mxml) with mediator in PrepViewCommand, and when I type app. there is no my component, what could be reason for this?
cmpPizzaOrderWindow is the problem...
public class PrepViewCommand extends SimpleCommand implements ICommand { override public function execute(notification:INotification):void { var app:DemoComboWithPureMVC = notification.getBody() as DemoComboWithPureMVC; facade.registerMediator(new PizzaOrderWindowMediator(app.cmpPizzaOrderWindow)); } }
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:components="view.components.*"> <mx:Script> <![CDATA[ private static const NAME:String="DemoComboWithPureMVC";
private var facade:ApplicationFacade=ApplicationFacade.getInstance(NAME);
private function init():void { facade.startup(this); } ]]> </mx:Script> <components:PizzaOrderWindow id="cmpPizzaOrderWindow" x="250.5" y="10"/> </mx:WindowedApplication>
|
|
|
5
|
Announcements and General Discussion / Getting Started / popup question
|
on: July 02, 2009, 01:10:19
|
How to register mediator for popup? I dont know what parameter to pass in: facade.registerMediator(new DetailsPopupMediaotr(???));
I use the following popup class, I wonder is this one http://www.nutrixinteractive.com/blog/?p=329 better, somehow? package util.popup { import flash.display.DisplayObject; import flash.display.Sprite;
import mx.core.Application; import mx.core.IFlexDisplayObject; import mx.managers.PopUpManager;
import org.puremvc.as3.multicore.patterns.facade.Facade;
/** * Used to handle popup opening controling registering and unregistering mediators * * @author */
public class PopManager extends PopUpManager { private static var popupList:Array=new Array();
/** * Opens a popup window. Window component is crated and mediator is assigned to it. * Targeted for PureMVC multicore so method requires moduleId to be passed */ public static function openPopUpWindow(ComponentClass:Class, MediatorClass:Class, moduleUid:String, modal:Boolean=true, parent:DisplayObject=null):IFlexDisplayObject { if (parent == null) { parent=Application.application as DisplayObject; } var window:IFlexDisplayObject=PopUpManager.createPopUp(parent, ComponentClass, modal); var obj:Facade=Facade.getInstance(moduleUid)as Facade;
obj.registerMediator(new MediatorClass(window)); PopUpManager.centerPopUp(window); return window; }
/** * Removes PopUp window and unregisteres associated mediator */ public static function closePopUpWindow(window:IFlexDisplayObject, mediatorName:String, moduleUid:String):void { PopUpManager.removePopUp(window); Facade.getInstance(moduleUid).removeMediator(mediatorName); }
/** * * Tries to retrieve popup window from the list of popups already opened. If there is no window opened with * provided mediator name associated with it, a new one is created and displayed. */ public static function retrievePopUp(ComponentClass:Class, MediatorClass:Class, mediatorName:String, moduleUid:String, modal:Boolean=true):IFlexDisplayObject { if (popupList[mediatorName]) { PopUpManager.addPopUp(popupList[mediatorName]as IFlexDisplayObject, Application.application as Sprite, modal); PopUpManager.bringToFront(popupList[mediatorName]); } else { popupList[mediatorName]=openPopUpWindow(ComponentClass, MediatorClass, moduleUid, modal) } return popupList[mediatorName]; }
/** * Removes popup from display list. The actual popup object still exists in the list and can be retrieved */ public static function hidePopUp(window:IFlexDisplayObject, mediatorName:String):void { PopUpManager.removePopUp(window); }
/** * Removes the popup completle. Also unregisters mediator. */ public static function destroyPopUp(window:IFlexDisplayObject, mediatorName:String, moduleUid:String):void { closePopUpWindow(window, mediatorName, moduleUid);
if (popupList[mediatorName]) { popupList[mediatorName]=null; } } }
}
|
|
|
6
|
Announcements and General Discussion / Getting Started / Where should data be stored
|
on: June 17, 2009, 06:30:05
|
Scenario: User type login data, proxy invoke loginMethod on server which after succesfull login return collection of user data (id, username, password, fname, lname, address, email etc.), now... After succesfull login loginControll is removed and application is in new state, here I wan't to display userDetails but I don't know how . After login where should I store returned users data so that I can use them later, and how to retrive them when I need them?
|
|
|
7
|
Announcements and General Discussion / Getting Started / Do I need proxies only to consume remote data
|
on: April 19, 2009, 04:39:19
|
Hello, my first post here wow I'm new to puremvc, and I wan't to learn it, I started today and got one question. I wan't to make simple hello world AIR application, I make main.mxml, one component that hold panel with my controls etc. Now I'm building mediator, my question is: If I want to hardcode my Hello sample (Hello, {name}) do I need proxy? As I understand proxie retrive data from remote source so IMHO I need to put my hello logic only in command, right? Sory for bad english. junior
|
|
|
|
|