Title: How to inform a new mediator/view about the data to display Post by: olist on October 09, 2008, 06:38:30 Hi all,
I'm new to PureMVC, so I guess the answer to my problem may be quite obvious: I work on a AS3 application, Flex is not envolved. I have a combo box containing an array of car objects, and the user can click a "View Details" button to open a layer with more information about the selected car. The layer I open is a view component that I create as soon as the notification is received: [ApplicationMediator.as] Now I want to know which is the best way to inform the new Mediator/Component about the object of interest, the car. Since there is no such thing as a CarProxy that knows the current selection, I pass the selected car as the body of the notification. But the mediator itself can't listen to the notification since it doesn't exist yet when the notification is sent. And as Cliff writes in his Best Practice guide, mediators should only react on notifications instead of providing an own API. I hope you can give me a hint what is the best practice for this case. Thanks, Oliver Title: Re: How to inform a new mediator/view about the data to display Post by: Joel Hooks on October 09, 2008, 06:53:41 the constructor for CarDetailsMediator:
private var car:Car; Then you can shove it into the view however you like. Title: Re: How to inform a new mediator/view about the data to display Post by: olist on October 09, 2008, 07:08:24 Thanks! That's pretty straight forward. Maybe I thought too much about asking Proxies, handling notifications and all that stuff.
|