Are you using a custom renderer? Sounds like it doesn't know how to be recycled. More about renderer recycling on my blog (blogs.adobe.com/aharui)
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Sent: Friday, December 21, 2007 2:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] tileList displaying items order other than that represented by dataProvider I have a problem with a viewStack that has 2 views, a dataGrid and a tileList view both of which which share a common dataProvider. - The tileList uses an itemRenderer to draw an icon/name for each item. - The datagrid affords the ability to sort the displayed items by clicking on the column headers. The initial display of both views is as expected, the sort order in the tileList view matches that of the items in the dataGrid view. A "trace" of the data items in the dataProvider invoked whenever I switch between views [via trace(datagrid.dataProvider) and trace(tilelist.dataProvider)] both show the items in the list in the order expected regardless of how many times I switch views back and forth. The items (a ListCollectionView of items of type "Foo") listed by the trace as expected reflect the format of the "toString" function in the Foo class. Now the problem... 1) When I click a header in the dataGrid view to re-sort the data subsequent trace output of the dataProvider's list of objects changes to another format: (Array)#0 [0] (com.emc.sspg.cem.data::Foo)#1 attribute1_name = value1 attribute2_name = value2 [1] (com.emc.sspg.cem.data::Foo)#1 etc. I'm not sure why this happens.. 2) The array elements in the trace output are reordered to reflect the expected sort order as displayed in the dataGrid view AND the tileList view BUT the order of the actual icons drawn in the tileList view does not match the order of the items traced. (In fact I've yet to be able to discern what order they are now drawn in, its not the original "pre-sorted" order either.) --------- Another subtlety my trace statements have pointed out is that only the 1st time the icon view is drawn do the item renderers get called to actually get the icon and name to display. Solution-wise, while not a great solution I've tried to insert various functions to invalidate the drawing such that subsequent views of the icon view would re-call the renderers to prove to me that they are being drawn in the order that I'm seeing them left-to-right, top-to-bottom in the tileList but none of the following cause that to occur. tilelist.invalidateDisplayList(); tilelist.invalidateList(); tilelist.invalidateProperties(); tilelist.dataProvider.refresh(); Any thoughts regarding this would be appreciated. Thanks