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: Independent component inside view  (Read 2421 times)
Arno
Newbie
*
Posts: 5


View Profile Email
« on: October 05, 2009, 06:46:54 »

I'm wondering how to solve this problem inside pureMVC. Maybe i'm making it to difficult.

I have an application that registering every mediator if the view is selected in the menu. If another view is selected the mediator gets removed. In some views I have the same component and it is cleaner to remove this part of the view and mediator for the different pages/views and put everything in 1 component. The problem is where can I register the mediator that is behind this component?

I think the best solution would be if I only have to say this in the parent view: <custom:Component id="testComponent"/>

And that the component himself would register the mediator. Or is there another way? Or should I register, assign and remove the mediator inside the mediator of the parent view?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: October 05, 2009, 07:13:51 »

Registering the mediator from within the component isn't what you want to do. The component should not be aware of its mediator. Instead, have the parent component's mediator do the registration.

-=Cliff>
Logged
Arno
Newbie
*
Posts: 5


View Profile Email
« Reply #2 on: October 05, 2009, 07:16:36 »

Oke! thank you for the fast reply
Logged
Pages: [1]
Print