That didn't quite make sense.  What is the dataprovider for the % list?  Why 
would different bundles have data items with the same UID?  Are you resetting 
the dataProvider when someone selects a different bundle?

If the dp for the % list is a set of fields computed from the selected bundle, 
don't reset the dp and have those items in the dp dispatch change events.  That 
should keep recycling to a minimum.  If that doesn't work, try using a DataGrid 
with 1 column and headers turned off.  It is possible that List has a different 
recycling algorithm than DG

From: [email protected] [mailto:[email protected]] On Behalf 
Of nwebb
Sent: Thursday, January 22, 2009 4:14 AM
To: flexcoders
Subject: [flexcoders] itemRenderer data question (recycling)


Hi,

I have 2 List components on a page.
The one on the left displays the names of some  "bundles" - e.g. "Bundle 1"
The one on the right displays the items in the selected bundle, plus a 
percentage value - e.g. "item1 - 10%"     "item2 - 55%"      "item3 - 61%"

The items are the same for all bundles, but their percentages may change as the 
user selects different bundles. If that happens I want to highlight that 
itemRenderer. (eg when the percentage changes, highlight renderer)


I looked at a similar example from Alex Harui - he compares a DataGrid's 
listData.UID to the previous UID (stored as a property on the renderer). If 
they match, he knows he has the same item and changes that value.

I have implemented IDropInListItemRenderer (so I have access to the UID) but 
the renderer-recycling of the List means that even when the UID's match, the 
"oldPercent" value I stored doesn't actually match up to item being displayed - 
in other words, the renderer which previously displayed "item1 - 10%" may now 
be displaying "item3 - 61%" , so the percentage HAS changed, but that's because 
it's displaying a different item!

Is my only option to send both the new% and old% in via the dataprovider, or is 
there another way to get around this issue?

Cheers




Reply via email to