Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
September 22, 2017, 02:50:38 AM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Print
Author Topic: Chaining mediator registration not working?  (Read 8276 times)
gary.paluk
Newbie
*
Posts: 3


View Profile
« on: October 22, 2012, 11:46:34 AM »

I am trying to register a view component with a mediator, then in the onRegister method of the mediator, I'm trying to register another component with another mediator. The first onRegister is called, yet the next is not.


So something like:

Code:
override public function onRegister(): void
{
   facade.registerMediator( new AppMediator( app ) );
}


=== Then, inside AppMediator ===

Code:
override public function onRegister(): void
{
   facade.registerMediator( new GameMediator( app.game ) );
}


There is obviously an app helper in the AppMediator. The first onRegister() gets called by the facade but the second onRegister() doesn't get called by the facade.


Any explanation, I thought this was standard practice?


Gary Paluk

P.S. All other objects exist and are tested to be instantiated.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #1 on: October 22, 2012, 05:11:00 PM »

Hi Gary,

This is definitely standard practice.

But it looks a little strange, what mediator is the first onRegister() a part of? The one that registers AppMediator?

It seems weird that the AppMediator wouldn't be registered by the StartupCommand.execute() method (passing in the app from the note body), and the GameMediator be subsequently registered by the AppMediator.onRegister().

Can you provide more context, e.g., the order of events that happens in your startup?

-=Cliff>
Logged
Pages: [1]
Print
Jump to: