[flexcoders] Re: Using custom item renderer with List
Thanks Alex specifying a rowHeight fixed the problem. However there's still an interesting/odd thing in this case which I forgot to mention in my post. The setter itself executes twice for every row in the list, and this also seems to be a default behaviour. To be more specific if the data provider recieves from the model: one, two, three, four , the data setter trace outputs: one two three four one two three four Cheers. PS. @Amy I have read the post on your blog, and to some extent you are right however in my case i was working with a repeater as a renderer before and it proved to be a killing performance issue. The repeater compenent created a new instance every time the model got updated. Considering the fact that I got 4 rows in the list and I was pooling data every 3 seconds that means at least 20 new object per minute. You can use the caching ootion of the repeater but still when profiling the appication the memory usage kept growing ang growing and never stop growing. When switched to List, the memory leak was not an issue anymore, but instead I got this 2 new issues one already fixed by Alex and the other one mentioned above. To conclude, event with the extra object created by the list it is still a better choice for me than the repeater.
Re: [flexcoders] Re: Using custom item renderer with List
is your renderer complex and using bindings? Try making use of invalidation approaches. eg, in set data() call invalidateProperties() and override commitProperties() where you do the actual work. Ely G has a great paper talking about this approach. http://flex.org/ACDS/BuildingAFlexComponent.pdf DK On Tue, May 20, 2008 at 1:26 AM, the_braniak [EMAIL PROTECTED] wrote: Thanks Alex specifying a rowHeight fixed the problem. However there's still an interesting/odd thing in this case which I forgot to mention in my post. The setter itself executes twice for every row in the list, and this also seems to be a default behaviour. To be more specific if the data provider recieves from the model: one, two, three, four , the data setter trace outputs: one two three four one two three four Cheers. PS. @Amy I have read the post on your blog, and to some extent you are right however in my case i was working with a repeater as a renderer before and it proved to be a killing performance issue. The repeater compenent created a new instance every time the model got updated. Considering the fact that I got 4 rows in the list and I was pooling data every 3 seconds that means at least 20 new object per minute. You can use the caching ootion of the repeater but still when profiling the appication the memory usage kept growing ang growing and never stop growing. When switched to List, the memory leak was not an issue anymore, but instead I got this 2 new issues one already fixed by Alex and the other one mentioned above. To conclude, event with the extra object created by the list it is still a better choice for me than the repeater. -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
RE: [flexcoders] Re: Using custom item renderer with List
If anything you do invalidates the List, it will re-render everything. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of the_braniak Sent: Tuesday, May 20, 2008 12:27 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Using custom item renderer with List Thanks Alex specifying a rowHeight fixed the problem. However there's still an interesting/odd thing in this case which I forgot to mention in my post. The setter itself executes twice for every row in the list, and this also seems to be a default behaviour. To be more specific if the data provider recieves from the model: one, two, three, four , the data setter trace outputs: one two three four one two three four Cheers. PS. @Amy I have read the post on your blog, and to some extent you are right however in my case i was working with a repeater as a renderer before and it proved to be a killing performance issue. The repeater compenent created a new instance every time the model got updated. Considering the fact that I got 4 rows in the list and I was pooling data every 3 seconds that means at least 20 new object per minute. You can use the caching ootion of the repeater but still when profiling the appication the memory usage kept growing ang growing and never stop growing. When switched to List, the memory leak was not an issue anymore, but instead I got this 2 new issues one already fixed by Alex and the other one mentioned above. To conclude, event with the extra object created by the list it is still a better choice for me than the repeater.
[flexcoders] Re: Using custom item renderer with List
Hi Douglas, Thanks for the reply, I'll have a look at this ASAP. To answer your question, about the complexity of the renderer it doesn 't matter, I tried it with a simple renderer and tests data and the behaviour is the same. The overidden data setter executes twice. I don't know if there is a way to prevent that since I am using a standard List. By the time the creatioComplete event is dispatched for the customItemRenderer componet the data setter has already executed several times. But that doesn't bother me. The thing is that on every change in the model the data setter executes twice for every row in the list and I'm expecting it to execute only once ... Cheers! --- In flexcoders@yahoogroups.com, Douglas Knudsen [EMAIL PROTECTED] wrote: is your renderer complex and using bindings? Try making use of invalidation approaches. eg, in set data() call invalidateProperties() and override commitProperties() where you do the actual work. Ely G has a great paper talking about this approach. http://flex.org/ACDS/BuildingAFlexComponent.pdf DK On Tue, May 20, 2008 at 1:26 AM, the_braniak [EMAIL PROTECTED] wrote: Thanks Alex specifying a rowHeight fixed the problem. However there's still an interesting/odd thing in this case which I forgot to mention in my post. The setter itself executes twice for every row in the list, and this also seems to be a default behaviour. To be more specific if the data provider recieves from the model: one, two, three, four , the data setter trace outputs: one two three four one two three four Cheers. PS. @Amy I have read the post on your blog, and to some extent you are right however in my case i was working with a repeater as a renderer before and it proved to be a killing performance issue. The repeater compenent created a new instance every time the model got updated. Considering the fact that I got 4 rows in the list and I was pooling data every 3 seconds that means at least 20 new object per minute. You can use the caching ootion of the repeater but still when profiling the appication the memory usage kept growing ang growing and never stop growing. When switched to List, the memory leak was not an issue anymore, but instead I got this 2 new issues one already fixed by Alex and the other one mentioned above. To conclude, event with the extra object created by the list it is still a better choice for me than the repeater. -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?
[flexcoders] Re: Using custom item renderer with List
--- In flexcoders@yahoogroups.com, the_braniak [EMAIL PROTECTED] wrote: Hi all, In my application I am pooling data every 3 seconds. The data goes into a model which updates a view. I am using a list with a custom Item renderer. In the custom itemRenderer I am overriding the data getter/setter. Everything works fine (the bindings and all) except one fact: the the DataProvider for the List contains only 4 items. When I trace out the data value in the overriden setter in the itemRenderrer the first item form the DataProvider is displayed twice. Has Anyone any ideea why? Does that means somehow that the list adds the first item from the dataProvider twice? When i log the length of the dataProvider it always display 4. This issue is giving me hedaches for a few days now ... code snippet: the overriden data porperty in the custom item renderer look as below private var _data : Object; override public function set data(val : Object) : void { trace(data setter = + val); this._data = val; } the trace always display 5 lines on every model update and the first item is displayed twice I also had this problem: http://flexdiary.blogspot.com/2008/04/is-horizontallist-faster-than- hbox-with.html