I've custom component which are using nested Spark Lists. Like
<MainComponent> it has 3 <comp1> components which has <s:List> inside and in each itemRenderer of this list is another List. All works nice except size invalidation. When deepest List itemRenderer change it's state which means it's height is changed, all parent Lists size should be updated. But it's not. I've also notifiad parent List with invalidateSize or invalidateDisplayList and measure() and updateDisplayList() is called but with old sizes. Only when I mouseover that components in new state (but wit old size), components are correctly resized. Another solution is change currentState on the deepest List itemRenderer back, and top List are rendered but "one step back" state size
So imagine this:
deepest itemRenderer has 2 states:
- closed: height = 0
- opened: height = 100;
- when I change state to "opened" itemRenderer has correct size:100px, but it's parent has size 0px. When I rollover that component, size is changed to 100px.
or other solution:
- I have change state to "opened" - parent size stay unchanged. I ave change state back to "close" and parent size is automatically 100px (1 step behind), when I change state to "opened" again, size is 0px (1 step behind)
I hope this is clear, can someone has any hint? or is this bug of Flex 4 beta 2?
thank you for your responses
Thanks for reporting, I think this is a bug. I created a small repro app and logged the bug here http://bugs.adobe.com/jira/browse/SDK-25605
For now one work-around would be to turn-off virtualization for the List that you're using (in case of nested lists, you'd need to turn virtualization off for both).
Hi Evtim, thank you for your response. Yes, it seems, it's bug. Also, one more question. If I have this List, and for itemRenderer, I have set visible and includeInLayout to "false" it shoudl also shrink, right? because it does not right now, but I have workaround with filtering dataProvider, instead of setting visibility and includeInLayout. But i;m just curious, if this is also bug, also it is not supposed to work like that...