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: Register Mediators  (Read 6493 times)
ssetem
Newbie
*
Posts: 4


View Profile Email
« on: March 30, 2009, 05:56:49 »



the setup:

have the main mxml file displaying a viewstack of a login panel and a main panel. inside the main panel there is two panels, a form panel and a list panel

On startup, the application mediator and the login mediator are attached to the application panel and to the login panel respectively. on login_successful event, the application mediator attaches the main panel mediator to the main panel. the main panel mediator then attaches mediators for the form panel and list panel.

The problem:

when registering the mediators for the form panel and list panel in the main panel mediator, the view component reference (to list / form panel) from the main panel is null. the reference from the main panel mediator to the form panel is null, the same applies to the list panel. The reason why is because the panels for form and list hasn't yet been rendered, therefore are null.

is there a way to eagerly load the panels? or is there a better way of architecting it to attach listeners to invoke the registermediator to happen after the panels have been created?

sorry im quite new to flex so any feedback on anyone who has come across a similar issue like this would be appreciated greatly.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: March 30, 2009, 04:16:47 »

Deferred instantiation. Check out this article and demo: http://puremvc.org/content/view/92/181/

-=Cliff>
Logged
Pages: [1]
Print