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: How to organizate views?  (Read 5513 times)
romulko
Newbie
*
Posts: 1


View Profile Email
« on: January 21, 2009, 03:27:05 »

Hello guys.  :)
Can anybody explain me how can I do with the pureMVC hierarchic views of mxml components?

If we have an login form at first time, and after user fill fields and push a button, this panel should remove from a view and new components will able to placed on the stage. And in according with the user's manipulation, this panels able to remove and in there place will able to place new components..

Some common questions:
- To create and registered a mediator, we using registerMediator (). Where I should placing code to create and add my *.mxml components to a place?
- If I don't want to use some view components and mediator for it anymore, what steps should I take to remove that from the scene?

Examples doesn't have big hierarchic of views and I haven't any ideas how this should work.

Help me please.
Thanks.
« Last Edit: January 21, 2009, 03:38:24 by romulko » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: January 21, 2009, 06:37:50 »

Adding new components to an existing component should happen via the existing component's mediator, though the actual creation of the child and its mediator might happen in a command.

Removal of a view component from an existing parent view component should happen within the parent component and result in an event reaching the removed component's mediator. The removed component's mediator can then null its reference to the removed view component and then call facade.removeMediator to remove itself.

For examples of view components dynamically added to the stage see HelloFlash, Slacker, Modularity and PipeWorks, The latter two use MultiCore which might be your best option given the description you've given of your app.

Hope this helps,
-=Cliff> 
Logged
Pages: [1]
Print