Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / General Discussion / How to properly manage application states on: January 09, 2009, 08:28:15

I'm building a complex application in flex with puremvc which envolves the managment of several sections with subsections, etc.

For example, when I want to switch between sections I need to have sure that the actual section has nothing to save.

Other case is for example when I'm in a following section and I use data of that section as input of the target section and then i want to get back to the original section.

Basicly what i need is somekind of state manager to handle confirm dialogs and switch between sections.

This must be a very common problem so I would love to hear the best way of doing this taking advantages of the pure mvc framework.

Thanks in advance,

With my best regards,

Nuno Santos
2  Announcements and General Discussion / Getting Started / Proxy notification for multiple mediators on: November 19, 2008, 08:48:32
Supose there are two mediators M1 and M2. There is also a proxy P that has a method list(path:String). This method will use a HTTPService to retrieve data. Once data is returned proxy P sends a notification. Both mediators M1 and M2 have interest on that notification.

Now, M1 retrieves the proxy P and calls list('fooo'). What is the best way to make sure M2 won't do a thing with the result notification?

Is it better to have a HTTPService for each mediator? Should both mediators check the notification body if they must ignore it?

3  Announcements and General Discussion / Getting Started / facade has proxy but it is null on: October 15, 2008, 03:54:55

I'm trying to retrieve a proxy from the facade but it comes null... dont understand why since its being constructed and initialized correctly.

This is what i'm doing:

accessProxy = facade.retrieveProxy(AccessProxy.NAME) as AccessProxy;

var loginVO:LoginVO = note.getBody() as LoginVO;
         var accessProxy:AccessProxy;
         if (facade.hasProxy(AccessProxy.NAME)) {
            accessProxy = facade.retrieveProxy(AccessProxy.NAME) as AccessProxy;
            if (accessProxy!=null)
               mx.controls.Alert.show("null proxy");
         else {
            mx.controls.Alert.show("Couldn't obtain proxy");

The proxy exists but it comes null.

Any tips?


Nuno Santos
4  Announcements and General Discussion / Getting Started / Can i send notifications from mediators to proxies? on: October 15, 2008, 02:30:44

Before I started doing anything in puremvc i read half of the documentation and try to put the example on the documentation working. I was a little bit disapointed with the example because it was not a complete sample.

In the example, the login command is declaraded on the application facade and then, onTryLogin a notification is sent for that.

However, in the diagram, its possible to comunicate directly between mediators and proxies and thats what i'm trying to do, but its not working.

This is what i'm doing in my mediator:

override public function listNotificationInterests():Array {
            return [AccessProxy.LOGIN,
      override public function handleNotification(notification:INotification):void
         switch(notification.getName()) {
            case AccessProxy.LOGIN:
               var loginProxy:AccessProxy = facade.retrieveProxy(AccessProxy.NAME) as AccessProxy;
               mx.controls.Alert.show("notification sent");
      private function onTryLogin(event:Event): void

Can anyone clarify me this?



5  Announcements and General Discussion / Getting Started / Doub about sending that from view to mediator on: October 14, 2008, 10:11:06

I'm trying to follow the good development guidelines of the pure mvc.

For that i'm making events in my buttons and then handle them in the mediator side.

The problem is that i need to send a parameter as well... How can i do that?

This is what i have:

// view side

public static const DELETE_USER:String = 'deleteUser';

<mx:Button label="Delete" click="sendEvent(DELETE_USER)" />

// mediator side

private function onDeleteUser():void
// i need to get the user id parameter
sendNotification( ApplicationFacade.USER_DELETE, usersList.selectedItem.@id );            

How can i do this?



6  Announcements and General Discussion / Getting Started / Problems sending notification on: October 14, 2008, 07:49:58

I'm giving my first steps in PureMVC.

I'have already done a login system and now i want to use the framework to manage visual state as well.

For that i have tried to follow the slaker example.

The thing is that after the access is granted, in my access proxie I invoke an AccessGranted notification which will do the following

public class AccessGrantedCommand extends SimpleCommand {
      override public function execute (note:INotification) : void {
         mx.controls.Alert.show("im here1");
         var applicationMediator:ApplicationMediator;
         mx.controls.Alert.show("NOTIFICATION SEN1");
         applicationMediator = facade.retrieveMediator("ApplicationMediator") as ApplicationMediator;
         mx.controls.Alert.show("NOTIFICATION SEN2");
         mx.controls.Alert.show("NOTIFICATION SEN3");

But no notifitcation is being released. I have placed some alerts to see what is happening and the third alert is not called.

Can anybody help me here?


Pages: [1]