[flexcoders] Cairngorm and TitleWindow issue

2006-04-13 Thread Suzy Lawson
I have a screen where a user can click an item in a List which pops
open a TitleWindow containing a form to update and save the data of
the items clicked. When the user clicks Save...the dispatched event
never reaches the FrontController (with the code like so):

// MyEvent extends CairngormEvent
var event : MyEvent = new MyEvent ( eventVO );
dispatchEvent( event );

HOWEVER...it does work if I do this. 

var event : MyEvent = new MyEvent ( eventVO );
Application.application.dispatchEvent( event );

It seems like the core Application can't pick up events dispatched
from a TitleWindow. Is this a known issue or am i missing something??

Thanks.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] Cairngorm and TitleWindow issue

2006-04-13 Thread Darron J. Schall
Suzy Lawson wrote:
 HOWEVER...it does work if I do this. 

 var event : MyEvent = new MyEvent ( eventVO );
 Application.application.dispatchEvent( event );

 It seems like the core Application can't pick up events dispatched
 from a TitleWindow. Is this a known issue or am i missing something??
   

This is a known issue and is a result of the way the PopUpManager 
works.  The reason you can't just dispatch the event from the popup is 
that the event doesn't bubble to the application to be picked up by the 
controller.  By dispatching the event from the application, you ensure 
the controller gets it.

The visual hierarchy, with a popup open, looks something like this 
(sorry for the bad ascii art):

SystemManager
   ||
  ApplicationPopup Window
 ||
ChildForm 1ChildForm 2

Notice that from Child form 1 or 2, the event will bubble up to the 
application and be picked up by the controller. but because the 
application itself is not the root of the hierarchy, the popup 
window's event will never bubble up to it.

Thus, this is a fact of life for now.  It's just the way the 
PopUpManager works (and an easy way to control modal-ness - you can 
just blur, shade, and block input to the entire Application branch 
without affecting the popup window).

-d


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/