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: Listen for component events inside mediator on: January 15, 2009, 07:06:40
After reading the Implementation Idioms and Best Practices once again I came to following conclusion:
Despite the seemingly redundant event handling in both the mediator and the MXML component it's probably better to dispatch custom events from the MXML component.

Especially possible later changes in the component won't necessarily force a change in the mediator.

Thanks goes to Cliff Hall for his excellent documentation.
2  Announcements and General Discussion / General Discussion / Listen for component events inside mediator on: January 14, 2009, 11:49:39
Hi all,

I have a Flex MXML navigation component with a couple of simple buttons inside, that has a mediator.

There are two options:
Setup event listeners for the buttons inside the MXML component and dispatch custom events for the mediator to be picked up.

Add event listeners inside the mediator, directly on the buttons inside the MXML component.
Like this: mainMenu.mainMenuButtonHelp.addEventListener(MouseEvent.CLICK, onHelpButtonClicked);

Does it break the view components encapsulation if I register for events from inside the mediator ?

It seems a bit redundant to dispatch custom events in the MXML component and then listen for those events inside the mediator.
3  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: November 10, 2007, 05:09:47
This is exactly what I was looking for!

Thanks for posting your findings.

Pages: [1]