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: Best practices question - Multi-window view  (Read 7192 times)
Walt
Courseware Beta
Newbie
***
Posts: 1


View Profile Email
« on: January 05, 2008, 07:24:12 »

Hi guys,

I'm putting together a multi window AIR app using PureMVC.

I'm running into an issue with mediator inter-dependency. What I have is a tabNavigator which has a menu (spun off with a separate mediator) which adds a new tab to the navigator.

I want to give the notification object I create to generate the new tab some idea of which window the "add tab" event occurred in. There will be several user gestures which will be window specific and without a clean mechanism of determining which window the gesture occurred in.

One working solution I found involved passing a windowID (generated when the window is first created by a WindowDataProxy up the Mediator tree. This duplicates lots of code and I think there must be a better way.

Another way to do this is to have a utility class which steps up the view heiararchy until it finds the parent window, but this is worse because if the container ever becomes something other than a window then the system breaks.

Wondering if anyone has an elegant solution to this problem,

Thanks,

-Walt
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: January 05, 2008, 08:45:14 »

You might try using the type property of the notification for this.

-=Cliff>
Logged
Pages: [1]
Print