Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
April 26, 2017, 04:27:36 PM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.
Pages: [1]
Print
Author Topic: Fabrication module view mediators receiving puremvc multicore notifications...  (Read 3962 times)
grimmwerks
Jr. Member
**
Posts: 14


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

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 PM »

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
Jump to: