Hi Tracy,

Thanks for the heads-up. I was aware that list based components recycle their 
item renderers. For example, when you scroll the list, it could break the 
component if there are some renderers that were already in the expanded states;)

I went ahead and did these in my component which subclasses List. 

(Dictating states of listItemRenderers in the List subcomponent)
http://maohao.com/blogs/wordpress/TestSimpleZoomableList/bin-release/TestSimpleZoomableList.html

(Letting the individual item renderers to decide which state they want to go)
http://weblogs.macromedia.com/pent/archives/2006/04/a_list_itemrend.html

After all the struggle, I found out there are really _a lot_ going on under the 
hood on a List/ListBase component (this includes "buffering" spare list item 
renderers, managing scrolling, clipping, etc.) When I have some time, I may 
just extend UIComponent, or hunt for some other components that are more 
tolerant of transitions...:)

Thanks and have a nice weekend.

-geng

--- In flexcoders@yahoogroups.com, "Tracy Spratt" <tspr...@...> wrote:
>
> I think I would approach this by having an "isExpanded" property on the
> dataProvider items, and toggle that property using logic in a change
> handler.  The renderer would use that property to set its visual state.
> 
>  
> 
> There won't be any clear relationship between selectedItems and the visual
> renderers.
> 
>  
> 
> Tracy Spratt,
> 
> Lariat Services, development services available
> 
>   _____  
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
> Behalf Of gwangdesign
> Sent: Friday, March 13, 2009 6:05 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] changes on item renderers on a List
> 
>  
> 
> Hi,
> 
> I am re-sending this question since this seemingly simple question has been
> taking me a bit much longer than I expected;)
> 
> I have a whole bunch of item renderers inside a List (or it lays out and
> scrolls the renderers the way a List does). Here is what I am trying to do:
> I'd like to expand/shrink these item renderers based on whether they are
> newly "selected" or "de-selected". My approach right now is extending List
> class. I listen to ListEvent.CHANGE event and invalidate my component as it
> occurs. I then try to figure out which renderer has been
> selected/deselected... and I can't.
> 
> Basically my component is interested in the following actions:
> 1. When "allowMultipleSelection" is true, user selects an item that hasn't
> been selected yet;
> 2. When "allowMultipleSelection" is true, user selects an already selected
> item;
> 3. When "allowMultipleSelection" is false, user selects a new item;
> 4. When "allowMultipleSelection" is false, user selects an already selected
> item;
> 
> I poke into the code of mx.controls.ListBase and List and the code is a bit
> over my head right now;)
> 
> Any ideas? pseudo code is welcome!
> 
> Thanks and have a great weekend!
> 
> -geng
>


Reply via email to