[flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread Amy
--- In flexcoders@yahoogroups.com, "Battershall, Jeff" 
<[EMAIL PROTECTED]> wrote:
>
> OK, I tried this but I get a compiler error - owner (which is a
> DisplayObjectContainer) doesn't have a property owner.

I've used code like this in the past

var myParent:*=owner

while (myParent.className!='ComboBox'){
  //pretty much everything will have either a parent or an owner
  if (!(myParent.owner==null)){
  myParent=myParent.owner;
  }else{
 myParent=myParent.parent;
  }
}

//myParent is a ComboBox if you get to this point

Note that you need to be REALLY sure this will eventually hit a 
ComboBox, or it will result in an endless loop.  You can add in a 
loop counter for safety, and exit after, say, 100 loops in case of a 
failure to find a combobox.

Possibly you could also extend ComboBox to listen to SystemManager 
and redispatch events.  

HTH;

Amy



RE: [flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread Battershall, Jeff
Simon,
 
I had done as you have described and I agree that it should be that
simple, but the fact that a ComboBox is using PopUpManager to show it's
list appears to be the issue.  Firing the event from my custom
itemRenderer doesn't seem to get noticed by the ComboBox.  Of course
there's always the possibility I'm not doing something correctly, but to
my knowledge, what you decribe SHOULD work.  I don't partcularly care
for this ListBase(owner).owner stuff but it does have the virtue of
working. 
 
Jeff
 
 
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Simon Bailey
Sent: Wednesday, July 09, 2008 2:48 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: ComboBox ItemRenderer Custom Events only
go to SystemManager - WHY?



Just as a precaution here, this owner parent stuff shouldn't be
necessary, you should be picking up the event flow, just to check have
you (a) set bubbles to true and (b) ensured if your using an mxml
component you've assigned the appropriate metadata tag for your custom
event in the ComboBox component i.e.
[Event(name="customSelect",
type="myevents.CustomEvent")]

Cheers,

Simon


newtriks.com <http://www.newtriks.com/> 


On 9 Jul 2008, at 19:30, Battershall, Jeff wrote:



OK, I tried this but I get a compiler error - owner (which is a
DisplayObjectContainer) doesn't have a property owner.

Jeff

-Original Message-
From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
Behalf Of reflexactions
Sent: Wednesday, July 09, 2008 2:17 PM
To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
    Subject: [flexcoders] Re: ComboBox ItemRenderer Custom Events
only go to
SystemManager - WHY?

Try owner.owner

Inside itemRenderer owner would be the List, the Lists' owner
would 
be the CB I think

--- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> , "Battershall, Jeff" 
<[EMAIL PROTECTED]> wrote:
>
> Alex,
> 
> I thought that might be the case, but when I use
> owner.dispatchEvent(myCustomEventInstance,true) from within my

> itemRenderer, and I have previously added an event listener to
my 
> ComboBox, no event is broadcast from my ComboBox.
> 
> Jeff
> 
> -Original Message-
> From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> ] 
> On Behalf Of Alex Harui
> Sent: Wednesday, July 09, 2008 1:47 PM
> To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> Subject: RE: [flexcoders] ComboBox ItemRenderer Custom Events
only go 
> to SystemManager - WHY?
> 
> 
> 
> Popups have to float over "everything" so they are parented by
> SM and not the CB or the app. If you dispatch the event off
the
> "owner" it will go to the CB and bubble up from there
> 
> 
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> ] 
> On Behalf Of Battershall, Jeff
> Sent: Wednesday, July 09, 2008 10:23 AM
> To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] ComboBox ItemRenderer Custom Events only
go to 
> SystemManager - WHY?
> 
> 
> 
> I've been remiss in addressing my less-than-perfect
understanding of
> Events and event bubbling.
> 
> My custom itemRenderer needs to fire a custom event. I've
spent
> the last
> day trying to get it to bubble up from my custom itemRenderer
to
> the
> ComboBox, but no dice. If I add an eventListener in my
ComboBox,
> it does
> not receive the event. However when I use
> systemManager.addEventListener("myCustomEvent",myHandler),
> suddenly I
> can receive the event.
> 
> Is this the expected behavior? Why?
&

Re: [flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread Simon Bailey
Just as a precaution here, this owner parent stuff shouldn't be  
necessary, you should be picking up the event flow, just to check have  
you (a) set bubbles to true and (b) ensured if your using an mxml  
component you've assigned the appropriate metadata tag for your custom  
event in the ComboBox component i.e.  
[Event(name="customSelect",  
type="myevents.CustomEvent")]


Cheers,

Simon

newtriks.com

On 9 Jul 2008, at 19:30, Battershall, Jeff wrote:

OK, I tried this but I get a compiler error - owner (which is a
DisplayObjectContainer) doesn't have a property owner.

Jeff

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of reflexactions
Sent: Wednesday, July 09, 2008 2:17 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: ComboBox ItemRenderer Custom Events only go to
SystemManager - WHY?

Try owner.owner

Inside itemRenderer owner would be the List, the Lists' owner would
be the CB I think

--- In flexcoders@yahoogroups.com, "Battershall, Jeff"
<[EMAIL PROTECTED]> wrote:
>
> Alex,
>
> I thought that might be the case, but when I use
> owner.dispatchEvent(myCustomEventInstance,true) from within my
> itemRenderer, and I have previously added an event listener to my
> ComboBox, no event is broadcast from my ComboBox.
>
> Jeff
>
> -Original Message-
> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED]
> On Behalf Of Alex Harui
> Sent: Wednesday, July 09, 2008 1:47 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] ComboBox ItemRenderer Custom Events
only go
> to SystemManager - WHY?
>
>
>
> Popups have to float over "everything" so they are parented by
> SM and not the CB or the app. If you dispatch the event off the
> "owner" it will go to the CB and bubble up from there
>
>
>
>
> 
>
>
> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED]
> On Behalf Of Battershall, Jeff
> Sent: Wednesday, July 09, 2008 10:23 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] ComboBox ItemRenderer Custom Events only
go to
> SystemManager - WHY?
>
>
>
> I've been remiss in addressing my less-than-perfect
understanding of
> Events and event bubbling.
>
> My custom itemRenderer needs to fire a custom event. I've
spent
> the last
> day trying to get it to bubble up from my custom itemRenderer
to
> the
> ComboBox, but no dice. If I add an eventListener in my
ComboBox,
> it does
> not receive the event. However when I use
> systemManager.addEventListener("myCustomEvent",myHandler),
> suddenly I
> can receive the event.
>
> Is this the expected behavior? Why?
>
> Jeff Battershall
> Application Architect
> Dow Jones Indexes
> [EMAIL PROTECTED] <mailto:jeff.battershall%40dowjones.com>
> (609) 520-5637 (p)
> (484) 477-9900 (c)
>



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






RE: [flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread Battershall, Jeff
OK, that works, thank you very much for your help. IMO, seems like an
awful lot of work to achieve this behavior, though.

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of reflexactions
Sent: Wednesday, July 09, 2008 2:39 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: ComboBox ItemRenderer Custom Events only go to
SystemManager - WHY?


Cast owner to something like ListBase to get round the compiler error.


--- In flexcoders@yahoogroups.com, "Battershall, Jeff" 
<[EMAIL PROTECTED]> wrote:
>
> OK, I tried this but I get a compiler error - owner (which is a
> DisplayObjectContainer) doesn't have a property owner.
> 
> Jeff
> 
> -Original Message-
> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> Behalf Of reflexactions
> Sent: Wednesday, July 09, 2008 2:17 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: ComboBox ItemRenderer Custom Events only
go to
> SystemManager - WHY?
> 
> 
> Try owner.owner
> 
> Inside itemRenderer owner would be the List, the Lists' owner would
> be the CB I think
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "Battershall, Jeff"
>  wrote:
> >
> > Alex,
> >  
> > I thought that might be the case, but when I use
> > owner.dispatchEvent(myCustomEventInstance,true) from within my
> > itemRenderer, and I have previously added an event listener to my 
> > ComboBox, no event is broadcast from my ComboBox.
> >  
> > Jeff
> > 
> > -Original Message-
> > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED]
> > On Behalf Of Alex Harui
> > Sent: Wednesday, July 09, 2008 1:47 PM
> > To: flexcoders@yahoogroups.com
> > Subject: RE: [flexcoders] ComboBox ItemRenderer Custom Events
> only go
> > to SystemManager - WHY?
> > 
> > 
> > 
> > Popups have to float over "everything" so they are parented by
> > SM and not the CB or the app.   If you dispatch the event off the
> > "owner" it will go to the CB and bubble up from there
> > 
> >  
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED]
> > On Behalf Of Battershall, Jeff
> > Sent: Wednesday, July 09, 2008 10:23 AM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] ComboBox ItemRenderer Custom Events only
> go to
> > SystemManager - WHY?
> > 
> >  
> > 
> > I've been remiss in addressing my less-than-perfect
> understanding of
> > Events and event bubbling.
> > 
> > My custom itemRenderer needs to fire a custom event. I've
> spent
> > the last
> > day trying to get it to bubble up from my custom itemRenderer
> to
> > the
> > ComboBox, but no dice. If I add an eventListener in my
> ComboBox,
> > it does
> > not receive the event. However when I use
> > systemManager.addEventListener("myCustomEvent",myHandler),
> > suddenly I
> > can receive the event.
> > 
> > Is this the expected behavior? Why?
> > 
> > Jeff Battershall
> > Application Architect
> > Dow Jones Indexes
> > jeff.battershall@ <mailto:jeff.battershall%40dowjones.com>
> > (609) 520-5637 (p)
> > (484) 477-9900 (c)
> >
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
Groups
> Links
>





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





[flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread reflexactions
Cast owner to something like ListBase to get round the compiler error.


--- In flexcoders@yahoogroups.com, "Battershall, Jeff" 
<[EMAIL PROTECTED]> wrote:
>
> OK, I tried this but I get a compiler error - owner (which is a
> DisplayObjectContainer) doesn't have a property owner.
> 
> Jeff
> 
> -Original Message-
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of reflexactions
> Sent: Wednesday, July 09, 2008 2:17 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: ComboBox ItemRenderer Custom Events only 
go to
> SystemManager - WHY?
> 
> 
> Try owner.owner
> 
> Inside itemRenderer owner would be the List, the Lists' owner would 
> be the CB I think
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "Battershall, Jeff" 
>  wrote:
> >
> > Alex,
> >  
> > I thought that might be the case, but when I use
> > owner.dispatchEvent(myCustomEventInstance,true) from within my 
> > itemRenderer, and I have previously added an event listener to my 
> > ComboBox, no event is broadcast from my ComboBox.
> >  
> > Jeff
> > 
> > -Original Message-
> > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] 
> > On Behalf Of Alex Harui
> > Sent: Wednesday, July 09, 2008 1:47 PM
> > To: flexcoders@yahoogroups.com
> > Subject: RE: [flexcoders] ComboBox ItemRenderer Custom Events
> only go 
> > to SystemManager - WHY?
> > 
> > 
> > 
> > Popups have to float over "everything" so they are parented by
> > SM and not the CB or the app.   If you dispatch the event off the
> > "owner" it will go to the CB and bubble up from there
> > 
> >  
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] 
> > On Behalf Of Battershall, Jeff
> > Sent: Wednesday, July 09, 2008 10:23 AM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] ComboBox ItemRenderer Custom Events only
> go to 
> > SystemManager - WHY?
> > 
> >  
> > 
> > I've been remiss in addressing my less-than-perfect
> understanding of
> > Events and event bubbling.
> > 
> > My custom itemRenderer needs to fire a custom event. I've
> spent
> > the last
> > day trying to get it to bubble up from my custom itemRenderer
> to
> > the
> > ComboBox, but no dice. If I add an eventListener in my
> ComboBox,
> > it does
> > not receive the event. However when I use
> > systemManager.addEventListener("myCustomEvent",myHandler),
> > suddenly I
> > can receive the event.
> > 
> > Is this the expected behavior? Why?
> > 
> > Jeff Battershall
> > Application Architect
> > Dow Jones Indexes
> > jeff.battershall@ <mailto:jeff.battershall%40dowjones.com>
> > (609) 520-5637 (p)
> > (484) 477-9900 (c)
> >
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups
> Links
>




RE: [flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread Battershall, Jeff
OK, I tried this but I get a compiler error - owner (which is a
DisplayObjectContainer) doesn't have a property owner.

Jeff

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of reflexactions
Sent: Wednesday, July 09, 2008 2:17 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: ComboBox ItemRenderer Custom Events only go to
SystemManager - WHY?


Try owner.owner

Inside itemRenderer owner would be the List, the Lists' owner would 
be the CB I think



--- In flexcoders@yahoogroups.com, "Battershall, Jeff" 
<[EMAIL PROTECTED]> wrote:
>
> Alex,
>  
> I thought that might be the case, but when I use
> owner.dispatchEvent(myCustomEventInstance,true) from within my 
> itemRenderer, and I have previously added an event listener to my 
> ComboBox, no event is broadcast from my ComboBox.
>  
> Jeff
> 
>   -Original Message-
>   From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] 
> On Behalf Of Alex Harui
>   Sent: Wednesday, July 09, 2008 1:47 PM
>   To: flexcoders@yahoogroups.com
>   Subject: RE: [flexcoders] ComboBox ItemRenderer Custom Events
only go 
> to SystemManager - WHY?
>   
>   
> 
>   Popups have to float over "everything" so they are parented by
> SM and not the CB or the app.   If you dispatch the event off the
> "owner" it will go to the CB and bubble up from there
> 
>
> 
>   
> 
> 
> 
>   From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] 
> On Behalf Of Battershall, Jeff
>   Sent: Wednesday, July 09, 2008 10:23 AM
>   To: flexcoders@yahoogroups.com
>   Subject: [flexcoders] ComboBox ItemRenderer Custom Events only
go to 
> SystemManager - WHY?
> 
>
> 
>   I've been remiss in addressing my less-than-perfect
understanding of
>   Events and event bubbling.
>   
>   My custom itemRenderer needs to fire a custom event. I've
spent
> the last
>   day trying to get it to bubble up from my custom itemRenderer
to
> the
>   ComboBox, but no dice. If I add an eventListener in my
ComboBox,
> it does
>   not receive the event. However when I use
>   systemManager.addEventListener("myCustomEvent",myHandler),
> suddenly I
>   can receive the event.
>   
>   Is this the expected behavior? Why?
>   
>   Jeff Battershall
>   Application Architect
>   Dow Jones Indexes
>   [EMAIL PROTECTED] <mailto:jeff.battershall%40dowjones.com>
>   (609) 520-5637 (p)
>   (484) 477-9900 (c)
>





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





[flexcoders] Re: ComboBox ItemRenderer Custom Events only go to SystemManager - WHY?????

2008-07-09 Thread reflexactions
Try owner.owner

Inside itemRenderer owner would be the List, the Lists' owner would 
be the CB I think



--- In flexcoders@yahoogroups.com, "Battershall, Jeff" 
<[EMAIL PROTECTED]> wrote:
>
> Alex,
>  
> I thought that might be the case, but when I use
> owner.dispatchEvent(myCustomEventInstance,true) from within my
> itemRenderer, and I have previously added an event listener to my
> ComboBox, no event is broadcast from my ComboBox.
>  
> Jeff
> 
>   -Original Message-
>   From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui
>   Sent: Wednesday, July 09, 2008 1:47 PM
>   To: flexcoders@yahoogroups.com
>   Subject: RE: [flexcoders] ComboBox ItemRenderer Custom Events
> only go to SystemManager - WHY?
>   
>   
> 
>   Popups have to float over "everything" so they are parented by
> SM and not the CB or the app.   If you dispatch the event off the
> "owner" it will go to the CB and bubble up from there
> 
>
> 
>   
> 
> 
> 
>   From: flexcoders@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of Battershall, Jeff
>   Sent: Wednesday, July 09, 2008 10:23 AM
>   To: flexcoders@yahoogroups.com
>   Subject: [flexcoders] ComboBox ItemRenderer Custom Events only
> go to SystemManager - WHY?
> 
>
> 
>   I've been remiss in addressing my less-than-perfect
> understanding of
>   Events and event bubbling.
>   
>   My custom itemRenderer needs to fire a custom event. I've 
spent
> the last
>   day trying to get it to bubble up from my custom itemRenderer 
to
> the
>   ComboBox, but no dice. If I add an eventListener in my 
ComboBox,
> it does
>   not receive the event. However when I use
>   systemManager.addEventListener("myCustomEvent",myHandler),
> suddenly I
>   can receive the event.
>   
>   Is this the expected behavior? Why?
>   
>   Jeff Battershall
>   Application Architect
>   Dow Jones Indexes
>   [EMAIL PROTECTED]
>  
>   (609) 520-5637 (p)
>   (484) 477-9900 (c)
>