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

Pages: [1]
Print
Author Topic: Fabrication module view mediators receiving puremvc multicore notifications...  (Read 8674 times)
grimmwerks
Jr. Member
**
Posts: 14


View Profile Email
« on: February 22, 2011, 01:35:20 »

Hey all

As outlined in another message - I've got an app where I'm using a puremvc / multicore / pipes library for connecting to a socket server; but my shell application and widgets are all fabrication. 

The gist is this:  does fabrication route 'respondTo' for sendNotification? Does it process sendNotification as if it were 'routeNotification('', null, null, "*")' ?  There's no way for me to use routeNotification from where I need to sendNotifications as the messager is puremvc, not fab.
Logged
grimmwerks
Jr. Member
**
Posts: 14


View Profile Email
« Reply #1 on: February 22, 2011, 02:28:30 »

I'm confused as the docs themselves seem to state that this is the case:

http://code.google.com/p/fabrication/wiki/GettingStarted


5. Send a now notification
Next we send a now notification using the PureMVC sendNotification method. We can do this from either the mediator or command. For this example we will use the startup command itself.

In controller/HelloFabricationStartupCommand.as

override public function execute(note:INotification):void {
        registerMediator(new HelloFabricationMediator(note.getBody()));
       
        sendNotification("now", new Date());
}
6. Respond to the now notification
In order to respond to the now notification we will use the respondTo syntax instead. By adding a respondToNow handler in the main mediator we indicate our interest in the now notification. The notification name must use lower camel case and the time of sending the notification, and is converted to upper camel case when handling the notification in the respondTo method.

In view/HelloFabricationMediator

public function respondToNow(note:INotification):void {
        trace("respondToNow time=" + note.getBody());
}



But I've got Modules that are using fabrication that are waiting to respondToOrderNew and don't seem to be getting the message. On top of which these notifications DO NOT seem to be the same:

routeNotification(MixConstants.ORDER_NEW, null, null, "*")
routeNotification(MixConstants.ORDER_NEW);

Two modules, each within the shell - when one sends the first message ("*") the sibling receives the message in it's respondToOrderNew. 
When the second one is sent, the other widget ignores it.

Worse still - when the first widget sends

sendNotification(MixConstants.ORDER_NEW);

the second widget ignores it as well.   I even tested with sendNotification(CRUD) and a 'respondToCrud' handler from one widget to another -- no go -- as well as putting a respondToCrud in the shell -- and THAT didn't get it either.

So do respondTo work with sendNotifications?


So is routeNotification(x, y, z, "*") necessary for sending info from





         //sendNotification(MixConstants.ORDER_NEW, null);
         routeNotification(MixConstants.ORDER_NEW);
Logged
Pages: [1]
Print