This content has been marked as final. Show 3 replies
itemRenderes are recycled. Only the visible items and a few for buffering, are ever created. When the data changes, or when you scroll, the framework sets the "data" property on every renderer, so it gets a new dataProvider item. The renderer must then use that data itm to update is visible ui. Best practice is to use the invalidateProperties() and commitProperties() appraoch.
The creation events, like initialize and creationComplete are only caled once, when the renderer is first created, and never again.
Thus, ALL DYNAMIC CHARACTERISTICS OF A RENDER MUST BE DATA-DRIVEN.
Advice: DO NOT START FROM SCRATCH. find an example renderer and modify it to suit your needs. There are very many examples available.
ntsii,you are very helpful(again).Thanks. I'll try what you said.
I tried to find how invalidateProperties() and commitProperties() approach work but didn't understand how i can make use of it in my case.But I read again what you said about how the renderer calls the set data property every time it is created and...voilla!!!! I overided the set data property and added some code about what to select when it is called(utilizing a singleton), so the problem with the selectedindex being changed is now solved.