Wonderful reply Tracy. Thanks. Bubbling the event, that's the perfect tip.

As for not being able to walk the items in the list, that seems
counter intuitive to me, but okay. As long as I know the behavior I
can find a way and stop pulling my hair out wondering why I can't do
what Flex doesn't do in the first place.

Thanks a ton for the clear and very helpful reply.

-M@

--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> If you are using dispatchEvent(new Event("change",true)) the second
> argument tells the event to "bubble" and you should be able to listen
> for it anywhere in the displayList, including the List, and Application.
> 
>  
> 
> However, it sounds suspiciously like you are not having your checkbox
> renderer update the dataProvider.  This is required. You cannot "walk
> any array of elements inside the list"  You must look at the
> dataProvider only.  The visual elements, including the checkboxes cease
> to exist when they are scrolled.
> 
>  
> 
> Tracy  
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Matt Maher
> Sent: Friday, December 22, 2006 4:07 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] ItemRenderers and Events
> 
>  
> 
> I'm having troubles with capturing events from an item in a List which
> uses an itemRenderer. 
> 
> Basically I'm overriding a multi-select List to have a checkbox in it
> with a simple itemRenderer. The item renderer is handling the clicks
> and managing the checkbox just fine. It also dispatches an event when
> clicked.
> 
> But when it comes time to listen to that event I don't know who to ask
> to listen to it. The component which included the List doesn't seem to
> care, and the List item itself surely doesn't seem to be attachable...
> 
> Another workaround was to capture all clicks on the LIST itself, then
> walk the itemRendered elements, asking each one if it was checked or
> not. That one baffles me. I cannot seem to walk any array of data
> elements inside the list. I can see the dataProvider array in the
> debugger, but I need the "itemRenderer" list so I have reference to
> the checkbox element.
> 
> This seemed so simple at first. Now I'm just flailing around.
>


Reply via email to