Re: [flexcoders] Re: FB4: Looping thru itemrenderers
You should control at the data provider level..not at the itemrenderer level..To make clear you first give 10 elements only to data provider and when user clicks then you update the data provider to give next 10 elements. This is more similar to our traditional approach of showing data in pagess, but here the difference is you already have the data here and you just manipulating it here.. THanks, Nagesh --- On Thu, 26/8/10, Amy amyblankens...@bellsouth.net wrote: From: Amy amyblankens...@bellsouth.net Subject: [flexcoders] Re: FB4: Looping thru itemrenderers To: flexcoders@yahoogroups.com Date: Thursday, 26 August, 2010, 3:25 AM Hm, I am not sure how you'd accomplish this with Flex 4, if you don't like the answers people have already given you. However, you could extend SkinnableDataContainer to allow you to add a style callback function similar to what AdvancedDataGrid uses. In Flex 3, I did similar with the TileList_withStyle and DataGrid_withStyle on flexdiary.blogspot.com. You may find that one of these fits your needs if you're not commited to spark only. HTH; Amy --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-em...@... wrote: Here's some additional insight into what I am trying to do. The user can click on one of the thumbnails(itemrenderer) which changes the background color and launches a larger version of the image. Within that larger image is a next and previous button which will navigate to the next/previous image(itemrenderer). I need to be able to change the background color of the next/previous thumbnail/itemrenderer. So, in essence, I need to determine the next/previous itemrenderer and call the function that will change the background color. Thanks. --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote: You should never do this. What is the end goal? --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-email@ wrote: I have a scrollable SkinnableDataContainer which contains thumbnail images (in an itemrenderer). While there can be several hundred thumbnail images, only 10 itemrenderers are viewable on the screen at a time. If I need to loop through the 10 viewable itemrenderers, what's the best way to do it? Thanks, in advance.
Re: [flexcoders] Re: FB4: Looping thru itemrenderers
Normally you should have a list and an underlying as a model dataprovider for your list. You could also keep a currentSelectedItem property in the model and bind the list selectedItem to that. You work with the underlying data and the list updates itself accordingly. Hopefully :). HTH, C From: sdl1326 azsl1326-em...@yahoo.com To: flexcoders@yahoogroups.com Sent: Wed, August 25, 2010 2:49:53 AM Subject: [flexcoders] Re: FB4: Looping thru itemrenderers Here's some additional insight into what I am trying to do. The user can click on one of the thumbnails(itemrenderer) which changes the background color and launches a larger version of the image. Within that larger image is a next and previous button which will navigate to the next/previous image(itemrenderer). I need to be able to change the background color of the next/previous thumbnail/itemrenderer. So, in essence, I need to determine the next/previous itemrenderer and call the function that will change the background color. Thanks. --- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote: You should never do this. What is the end goal? --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-email@ wrote: I have a scrollable SkinnableDataContainer which contains thumbnail images (in an itemrenderer). While there can be several hundred thumbnail images, only 10 itemrenderers are viewable on the screen at a time. If I need to loop through the 10 viewable itemrenderers, what's the best way to do it? Thanks, in advance.
[flexcoders] Re: FB4: Looping thru itemrenderers
Thanks for the assistance. I posted what I was trying to accomplish in the reply above. Ultimately, I need to be able to access the next or previous itemrenderer from the one that is currently selected. --- In flexcoders@yahoogroups.com, Gregor Kiddie gregor.kid...@... wrote: If you need to access an itemrenderer, there's almost always a better way of doing what you are trying to do... So, why are you wanting to access the itemrenderer instance? Gk.
RE: [flexcoders] Re: FB4: Looping thru itemrenderers
You should have a background color stored in -- or associated with, in some way -- each data item. Then you should access the next and previous data item, change the background color, and let the renderer re-render the data item. You cannot generally access the next and previous item renderer, because they may not exist yet. Item renderers get created on demand as items scroll into view. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of sdl1326 Sent: Wednesday, August 25, 2010 9:48 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: FB4: Looping thru itemrenderers Thanks for the assistance. I posted what I was trying to accomplish in the reply above. Ultimately, I need to be able to access the next or previous itemrenderer from the one that is currently selected. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gregor Kiddie gregor.kid...@... wrote: If you need to access an itemrenderer, there's almost always a better way of doing what you are trying to do... So, why are you wanting to access the itemrenderer instance? Gk.
[flexcoders] Re: FB4: Looping thru itemrenderers
Thanks for the insight. I think that maybe I am not being as clear as I need to be. Apologies for this. The itemrenderer has two colors for selected and not selected (blue/red). When an itemrenderer is clicked, the background color changes to red and a popup is launched, via PopUpManager, containing a larger version of the selected image and the 2 navigation buttons(Next/Prev). Clicking, for example, the 'Next' button in the popup will load the next image from the dataprovider in the popup, however, it will not select the next associated thumbnail(itemrenderer). This is the core issue. I need to know how to select the next (or previous) itemrenderer in the datacontainer once one of the navigation buttons is selected. This needs to be done without actually clicking on the itemrenderer. Hope these details clear up some of the confusion. Thank you! --- In flexcoders@yahoogroups.com, Gordon Smith gosm...@... wrote: You should have a background color stored in -- or associated with, in some way -- each data item. Then you should access the next and previous data item, change the background color, and let the renderer re-render the data item. You cannot generally access the next and previous item renderer, because they may not exist yet. Item renderers get created on demand as items scroll into view. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of sdl1326 Sent: Wednesday, August 25, 2010 9:48 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: FB4: Looping thru itemrenderers Thanks for the assistance. I posted what I was trying to accomplish in the reply above. Ultimately, I need to be able to access the next or previous itemrenderer from the one that is currently selected. --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Gregor Kiddie gregor.kiddie@ wrote: If you need to access an itemrenderer, there's almost always a better way of doing what you are trying to do... So, why are you wanting to access the itemrenderer instance? Gk.
[flexcoders] Re: FB4: Looping thru itemrenderers
Hm, I am not sure how you'd accomplish this with Flex 4, if you don't like the answers people have already given you. However, you could extend SkinnableDataContainer to allow you to add a style callback function similar to what AdvancedDataGrid uses. In Flex 3, I did similar with the TileList_withStyle and DataGrid_withStyle on flexdiary.blogspot.com. You may find that one of these fits your needs if you're not commited to spark only. HTH; Amy --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-em...@... wrote: Here's some additional insight into what I am trying to do. The user can click on one of the thumbnails(itemrenderer) which changes the background color and launches a larger version of the image. Within that larger image is a next and previous button which will navigate to the next/previous image(itemrenderer). I need to be able to change the background color of the next/previous thumbnail/itemrenderer. So, in essence, I need to determine the next/previous itemrenderer and call the function that will change the background color. Thanks. --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote: You should never do this. What is the end goal? --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-email@ wrote: I have a scrollable SkinnableDataContainer which contains thumbnail images (in an itemrenderer). While there can be several hundred thumbnail images, only 10 itemrenderers are viewable on the screen at a time. If I need to loop through the 10 viewable itemrenderers, what's the best way to do it? Thanks, in advance.
[flexcoders] Re: FB4: Looping thru itemrenderers
You should never do this. What is the end goal? --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-em...@... wrote: I have a scrollable SkinnableDataContainer which contains thumbnail images (in an itemrenderer). While there can be several hundred thumbnail images, only 10 itemrenderers are viewable on the screen at a time. If I need to loop through the 10 viewable itemrenderers, what's the best way to do it? Thanks, in advance.
[flexcoders] Re: FB4: Looping thru itemrenderers
Here's some additional insight into what I am trying to do. The user can click on one of the thumbnails(itemrenderer) which changes the background color and launches a larger version of the image. Within that larger image is a next and previous button which will navigate to the next/previous image(itemrenderer). I need to be able to change the background color of the next/previous thumbnail/itemrenderer. So, in essence, I need to determine the next/previous itemrenderer and call the function that will change the background color. Thanks. --- In flexcoders@yahoogroups.com, Amy amyblankens...@... wrote: You should never do this. What is the end goal? --- In flexcoders@yahoogroups.com, sdl1326 azsl1326-email@ wrote: I have a scrollable SkinnableDataContainer which contains thumbnail images (in an itemrenderer). While there can be several hundred thumbnail images, only 10 itemrenderers are viewable on the screen at a time. If I need to loop through the 10 viewable itemrenderers, what's the best way to do it? Thanks, in advance.