Hey Alex, thanks a lot for your reply. So it is *proper* behaviour that if
you setItemAt in a custom itemrenderer that the whole control is rebuilt
visually? Incidentally I am using Flex 4, so this might be of even more
interest.
I have a SkinnableDataContainer with an ArrayCollection dataprovider that
holds custom objects ('reports' in this case).
If my current collection has:
1. Report #1 = Name: 1stReportName, Path: 1stReportPath
2. Report #2 = Name: 2ndReportName, Path: 2ndReportPath
And then I do a myArrayCollection.setItemAt(Report1, 0), which basically
sets the first item to the same report it currently has. The itemrenderer
empties of all items, then re-displays them, causing a flicker or flash that
is noticeable on a slow computer.
Wouldn't it make more sense for the itemrender NOT to re-build itself from
scratch on every change? What if you had 100 items and u onl;y set one item?
Thanks a lot!
Baz
On Mon, Oct 5, 2009 at 3:05 PM, Alex Harui <[email protected]> wrote:
>
>
> It depends on how you wrote the renderer. You can try overriding the
> “function set data()” to check for changes to the object referenced by the
> renderer, but then if some sub-property changes, the renderer will not
> update.
>
>
>
> Might be better to understand why it flickers when updating.
>
>
>
> Alex Harui
>
> Flex SDK Developer
>
> Adobe Systems Inc. <http://www.adobe.com/>
>
> Blog: http://blogs.adobe.com/aharui
>
>
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Baz
> *Sent:* Monday, October 05, 2009 12:32 PM
> *To:* [email protected]
> *Subject:* [flexcoders] custom itemrender flicker
>
>
>
>
>
> If I have a custom item render based on an ArrayCollection with 10 times,
> and just for fun, I loop through those 10 items and setItemAt the exact same
> values that are already there - on screen the list of items reloads in a
> sense, re-building itself to the exact same values. I would like that in
> such a case, the on-screen controls know that they are the same as before
> and not to rebuild themselves. Is this possible? Can I intercept some event
> to double check whether they are the same or different?
>
> The goal of course, is to have this behaviour even if one some items
> changed. For example if I change only the 10th item, I would expect only the
> 10th item to refresh, no the whole collection.
>
> Thanks for any ideas!
>
> P.S. I am not useing refresh() on the ArrayCollection is it set to
> auto-update. Also, all my setItemAt calls are done in commitProperties()
>
>
>