Best way to use different ItemRenderers in a list?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Best way to use different ItemRenderers in a list?

I have a list that changes based on the data available. At first i did 1 item
renderer that checked everything in set data and added or removed elements
from the item. However, when scrolled or refreshed the dataprovider, I was
either getting crashes or duplicated elements.

Is the issue, creating new elements in set data? What would be the best
approach to this?

My current solution was to use an ItemrendererFactory so if data.checkin,
data.image and exists it is itemrenderer1 if only data.image exist
it is itemrenderer2, if nothing exists then itemrenderer3. But with this I
am not sure if itemrenderers are actually reused with virtualization on. Can
someone confirm they are actually reused?

Sent from: