[flexcoders] Re: Hook/Event when Item Renderers visible in List?
Hi, There aren't any non-visible itemRenderers in a list; except for maybe one extra at the bottom. ItemRenderers are recycled; meaning that they are reused with just the data changing. When a list is scrolled, you should be able to catch the data change in the set data method. -TH --- In flexcoders@yahoogroups.com, liu_bai_un brian...@... wrote: Looking for an event/hook where non-visible item renderers are made visible. Item Renderers apparently don't respond to: 1. creationComplete (only works for the first group visible on list creation) 2. override set data (same)
RE: [flexcoders] Re: Hook/Event when Item Renderers visible in List?
Yep, and to follow on a bit: When working with data driven controls, like List, Tree, DataGrid, you always work with the *underlying data*, almost never with the rendered UI item instances. Do not attempt to create an interactive itemRenderer from scratch unless you are an expert. Find an example, thare many, and modify it to fit your needs. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tim Hoff Sent: Wednesday, April 15, 2009 12:48 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Hook/Event when Item Renderers visible in List? Hi, There aren't any non-visible itemRenderers in a list; except for maybe one extra at the bottom. ItemRenderers are recycled; meaning that they are reused with just the data changing. When a list is scrolled, you should be able to catch the data change in the set data method. -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, liu_bai_un brian...@... wrote: Looking for an event/hook where non-visible item renderers are made visible. Item Renderers apparently don't respond to: 1. creationComplete (only works for the first group visible on list creation) 2. override set data (same)
[flexcoders] Re: Hook/Event when Item Renderers visible in List?
Thanks for the responses. It would help if Adobe documented the reuse concept better in their ListBase class. The reuse concept may be better optimized for performance, but it causes issues for code that is still running after the change in data. For example, I'm using an HTTPService response to parse the data, but the response comes 2-3 itemrenderer data sets later. Could you suggest any workarounds? Thanks! --- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote: Yep, and to follow on a bit: When working with data driven controls, like List, Tree, DataGrid, you always work with the *underlying data*, almost never with the rendered UI item instances. Do not attempt to create an interactive itemRenderer from scratch unless you are an expert. Find an example, thare many, and modify it to fit your needs. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tim Hoff Sent: Wednesday, April 15, 2009 12:48 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Hook/Event when Item Renderers visible in List? Hi, There aren't any non-visible itemRenderers in a list; except for maybe one extra at the bottom. ItemRenderers are recycled; meaning that they are reused with just the data changing. When a list is scrolled, you should be able to catch the data change in the set data method. -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, liu_bai_un brianliu@ wrote: Looking for an event/hook where non-visible item renderers are made visible. Item Renderers apparently don't respond to: 1. creationComplete (only works for the first group visible on list creation) 2. override set data (same)
RE: [flexcoders] Re: Hook/Event when Item Renderers visible in List?
Yes, make everything event and/or data driven and you will not have any problems. I do not understand what you mean by, the response comes 2-3 itemrenderer data sets later. The result comes when it comes, you cannot predict or rely on when that is, but must use a result handler. Have the result handler update the data model, and bind the UI to the data Model. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of liu_bai_un Sent: Wednesday, April 15, 2009 5:42 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Hook/Event when Item Renderers visible in List? Thanks for the responses. It would help if Adobe documented the reuse concept better in their ListBase class. The reuse concept may be better optimized for performance, but it causes issues for code that is still running after the change in data. For example, I'm using an HTTPService response to parse the data, but the response comes 2-3 itemrenderer data sets later. Could you suggest any workarounds? Thanks! --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tracy Spratt tspr...@... wrote: Yep, and to follow on a bit: When working with data driven controls, like List, Tree, DataGrid, you always work with the *underlying data*, almost never with the rendered UI item instances. Do not attempt to create an interactive itemRenderer from scratch unless you are an expert. Find an example, thare many, and modify it to fit your needs. Tracy Spratt, Lariat Services, development services available _ From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of Tim Hoff Sent: Wednesday, April 15, 2009 12:48 PM To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Subject: [flexcoders] Re: Hook/Event when Item Renderers visible in List? Hi, There aren't any non-visible itemRenderers in a list; except for maybe one extra at the bottom. ItemRenderers are recycled; meaning that they are reused with just the data changing. When a list is scrolled, you should be able to catch the data change in the set data method. -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, liu_bai_un brianliu@ wrote: Looking for an event/hook where non-visible item renderers are made visible. Item Renderers apparently don't respond to: 1. creationComplete (only works for the first group visible on list creation) 2. override set data (same)
RE: [flexcoders] Re: Hook/Event when Item Renderers visible in List?
And I noticed a misunderstanding in your original post. The set data() function *is* called every time the underlying data changes and is the most important function in a itemRenderer. Note, you should not do the actual work in set data() but rather call invalidateProperties() and do the work in commitProperties(). As I said, find an example. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Wednesday, April 15, 2009 8:29 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Hook/Event when Item Renderers visible in List? Yes, make everything event and/or data driven and you will not have any problems. I do not understand what you mean by, the response comes 2-3 itemrenderer data sets later. The result comes when it comes, you cannot predict or rely on when that is, but must use a result handler. Have the result handler update the data model, and bind the UI to the data Model. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of liu_bai_un Sent: Wednesday, April 15, 2009 5:42 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Hook/Event when Item Renderers visible in List? Thanks for the responses. It would help if Adobe documented the reuse concept better in their ListBase class. The reuse concept may be better optimized for performance, but it causes issues for code that is still running after the change in data. For example, I'm using an HTTPService response to parse the data, but the response comes 2-3 itemrenderer data sets later. Could you suggest any workarounds? Thanks! --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tracy Spratt tspr...@... wrote: Yep, and to follow on a bit: When working with data driven controls, like List, Tree, DataGrid, you always work with the *underlying data*, almost never with the rendered UI item instances. Do not attempt to create an interactive itemRenderer from scratch unless you are an expert. Find an example, thare many, and modify it to fit your needs. Tracy Spratt, Lariat Services, development services available _ From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of Tim Hoff Sent: Wednesday, April 15, 2009 12:48 PM To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Subject: [flexcoders] Re: Hook/Event when Item Renderers visible in List? Hi, There aren't any non-visible itemRenderers in a list; except for maybe one extra at the bottom. ItemRenderers are recycled; meaning that they are reused with just the data changing. When a list is scrolled, you should be able to catch the data change in the set data method. -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, liu_bai_un brianliu@ wrote: Looking for an event/hook where non-visible item renderers are made visible. Item Renderers apparently don't respond to: 1. creationComplete (only works for the first group visible on list creation) 2. override set data (same)