PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: flex.net on January 27, 2009, 05:05:57



Title: ViewStack and registering mediator
Post by: flex.net on January 27, 2009, 05:05:57
Hi,

I've followed the Slacker-demo and I've done my application so that I've Main.mxml where's MainDisplay-view and inside MainDisplay there's ViewStack where's Startup-view and Summary-view. For Summary-view I've a button to show the view. But Startup-view shows first. Now everything works ok, expect it seems that Startup-view's mediator doesn't get registered. I've put
:
sendNotification( ApplicationFacade.STARTUP_MODE ); in StartupCommand.as and MainDisplayMediator seems to trigger that 'cos it's showing Startup-view. But Startup-view never dispatch event in creationComplete. Summary-view works ok when I click my button which also sends notifications to MainDisplayMediator. Any help? And please ask more code to see if needed.


Title: Re: ViewStack and registering mediator
Post by: flex.net on January 27, 2009, 07:41:17
Now I think that I found answer why my StartupViewMediator is not registered from this post: http://forums.puremvc.org/index.php?topic=879.0 (http://forums.puremvc.org/index.php?topic=879.0).

So now I fixed my problem so that in MainDisplayMediator's onRegister-function I use facade.registerMediator to register my StartupViewMediator. But if I understood right from the linked post, it's not prefferred way?