Title: Open a popup form by MainViewMediator ? is it the good way ? Post by: fidiman on September 23, 2008, 05:43:39 Hi,
I need to open a form with popupmanager. The form is one of the components view. So i've added a mediator to the MainView that have the responsability to manage the popup. package com.freddufau.eshop.view So i've needed to create the static var MAIN_VIEW in the facade to hold the popup on top. Is this a good way ? And to close, i will listen the closeNotification ? Thanks; Title: Re: Open a popup form by MainViewMediator ? is it the good way ? Post by: puremvc on September 23, 2008, 08:52:03 Although you may overload a Mediator's responsibilities by having it deal additionally with the Popups that its view component invokes, you will find this is really not a good way to go. For apps with popups that are more complex, you generally want a mediator just for the popup. But that means registering and unregistering that popup's Mediator when invoked and is dismissed.
Here is a great solution: http://www.nutrixinteractive.com/blog/?p=76 In this article, Simon creates a simple 'PopManager' class with static functions for showing a popup and registering its Mediator, or dismissing it and removing the Mediator. -=Cliff> Title: Re: Open a popup form by MainViewMediator ? is it the good way ? Post by: fidiman on September 24, 2008, 12:14:05 Ok thanks for this helpful link.
I wasn't thinking about removeMediator :-* Title: Re: Open a popup form by MainViewMediator ? is it the good way ? Post by: newtriks on February 08, 2009, 08:58:05 Here is an update to that logic:
http://www.nutrixinteractive.com/blog/?p=329 (http://www.nutrixinteractive.com/blog/?p=329) |