I am developing Desktop Application using Flex/AIR and I have problem with Spark List control.
The case is the following: I have a list with item renderer. I do not use itemRendererFunction, so I have just one type of renderer. However this renderer can have different size, depending of the type of the data connected to it. Please see the code of my ItemRenderer:
<s:HGroup verticalAlign="middle">
<s:CheckBox id="glazingNorthCheckBox" selected="false"/>
<s:TextInput text="{data is VerticalSolidComponent ? data.window.areaNorth : data.skylight.area}"/>
<s:Label text="m²"/>
</s:HGroup>
<s:HGroup verticalAlign="middle" includeInLayout="{data is VerticalSolidComponentWithGlazing}"
visible="{data is VerticalSolidComponentWithGlazing}">
<s:CheckBox id="glazingEastCheckBox" selected="false"/>
<s:TextInput text="{data.window.areaEast}"/>
<s:Label text="m²"/>
</s:HGroup>
So as you see the second HGroup is not always included in layout. That is why my list is calculating wrong height.
Here you can see the code for the list:
<s:List id="solidComponentsList" dataProvider="{data.solidComponents}" itemRenderer="View.BuildingGeometry.DetailView.SolidComponentItemRenderer" skinClass="View.Skins.CustomListSkin" useVirtualLayout="true">
<s:layout>
<s:VerticalLayout gap="10" horizontalAlign="left" variableRowHeight="true" useVirtualLayout="true" paddingTop="20" paddingLeft="20" requestedMaxRowCount="4"/>
</s:layout>
</s:List>
Can you give me some advice how to calculate the correct size of the list?
Thank you in advance!