Westside
|
|
« on: December 03, 2008, 04:48:46 » |
|
Hi,
Can someone provide a coding example of how I can have one mediator mediate two views? So far I have this code (below) which works for one mediator and one view, but it seems like a lot of extra work to have one mediator for every view component so I would like my "mediator" to mediate for two views for example.
Here is my existing code:
public static const NAME:String = 'SearchMediator';
public function SearchMediator( viewComponent:Object ) { super( NAME, viewComponent ); peopleSearch.addEventListener( PeopleSearch.LOAD_CATEGORY_TREE, doTreeLoad ); } override public function getMediatorName():String { return NAME; } protected function get peopleSearch():PeopleSearch { return viewComponent as PeopleSearch; }
private function doTreeLoad(event:Event):void { sendNotification( ApplicationFacade.LOAD_CATEGORY_TREE ); }
Any help highly appreciated.
-Westside
|