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 [2]
Author Topic: Register and remove mediators in runtime, where to put it?  (Read 15646 times)
Sr. Member
Posts: 52

View Profile Email
« Reply #15 on: July 10, 2009, 01:54:51 »

But you sometimes do need to have a 'happy path' with various steps leading to loops to gather data or whatever before continuing, or even to bail out altogether.

Couldn't this be achieved using the AsynchCommand utility? Or am I misunderstanding you?

In my code there's actually is a need to wait for a server to respond with the page data. At the moment I just initialize the loading from my LoadPageDataCommand and the responsible proxy sends a notification when the data is recieved (which all display mediators listens for).

But it would be cleaner if I could just wait for the data before creating the new page (at the moment it's created empty and populated later).

And just for the record, I really appreciate all the help you're giving me, thanks again.
Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #16 on: July 10, 2009, 08:16:56 »

The MainDisplayMediator would be interested in CHANGE_PAGE. If it requests a page other than the current THEN it would kick off the OUT transition, and when the transition completes, send the note that triggers a Command to set the new page and register the mediator. That Command would send a notification PAGE_CHANGED, say, and the Mediator would then kick of the IN transition.

And no there's no way for one observer to keep another observer from being notified.
Pages: 1 [2]