Binding custom objects to Tilelist with itemRenderer
[The following was created as of Flex 2, Beta 2]
It's not uncommon to want to bind a class to one of the List based components (i.e. List, TileList, DataGrid, etc). But if you're using an itemRenderer you may run into an issue where the itemRenderers do not get unique id's. When this happens, focus and selection cannot function properly. Usually, just one of the items in the list will get highlighted no matter which item your cursor is over.
So the way to get around this, is to simply have your class implement IUID which will automatically assign a unique id to each item renderer.
Here's a sample:
View the source here
It's not uncommon to want to bind a class to one of the List based components (i.e. List, TileList, DataGrid, etc). But if you're using an itemRenderer you may run into an issue where the itemRenderers do not get unique id's. When this happens, focus and selection cannot function properly. Usually, just one of the items in the list will get highlighted no matter which item your cursor is over.
So the way to get around this, is to simply have your class implement IUID which will automatically assign a unique id to each item renderer.
Here's a sample:
View the source here
Save This Page
Comments
Thanks for the heads up. Saved me a couple hours of trying to figure out what the hell was up.
Posted by: Akeem | March 28, 2006 07:54 PM