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

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / General Discussion / Re: reusable components on: February 12, 2008, 09:44:37
Hi Cliff! Thanks for an answer!

however, from adobe's documentation:

Navigator containers such as Accordion, TabNavigator, and ViewStack implement the ContainerCreationPolicy.AUTO policy by creating all their children immediately, but wait to create the deeper descendants of a child until it becomes the selected child of the navigator container

i.e. there is no point in listening a child's creationComplete event, rather we need to listen a child's child, this may be a code bloat... Could ViewStack's "change" event help?
2  Announcements and General Discussion / General Discussion / reusable components on: February 12, 2008, 07:23:42
Hello!

Can someone guide me on developing reusable view components with puremvc/flex?

My app has two views - welcome screen and failed login screen (WelcomeVew, FailedLoginView), both have the same SignupBoxView MXML component.
SignupBoxView has a corresponding SignupBoxMediator. I'm using ViewStack to manage views:

:
<mx:Application>

        .....

<mx:ViewStack id="topStack" width="100%" height="100%">

<view:WelcomeView id="welcomeView" />
<view:FailedLoginView id="failedLoginView" />

        </mx:ViewStack>

</mx:Application>


I'm trying to register mediators in ApplicationMediator's constructor

:
public function ApplicationMediator(viewComponent:Object)
{
super(viewComponent);

// welcome view
facade.registerMediator(new WelcomeMediator(app.welcomeView));

                        // welcome's signup box
                        facade.registerMediator(new SignupBoxMediator(app.welcomeView.signupBox));

// failed login view
facade.registerMediator(new FailedLoginMediator(app.failedLoginView));

                        // failed login's signup box
                        facade.registerMediator(new SignupBoxMediator(app.failedLoginView.signupBox));

appProxy = ApplicationProxy(facade.retrieveProxy(ApplicationProxy.NAME));
}

unfortunately, this not works for me, since app.failedLoginView is not a selectedChild of my ViewStack at the time of a facade startup and thus app.failedLoginView.signupBox is null.

Am I doing something completely wrong?
Pages: [1]