0

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!

zero323
  • 322,348
  • 103
  • 959
  • 935
Ivan Nikolov
  • 235
  • 2
  • 18
  • What is your actual question? Which size do you need to calculate? Height of List, number of items.. or what? And where do you do calculation? – Nemi Jul 05 '13 at 14:09
  • 1
    Did you set [variableRowHeight](http://flex.apache.org/asdoc/spark/layouts/VerticalLayout.html#variableRowHeight)? – RIAstar Jul 05 '13 at 14:38
  • What RIAstar said. You might as well show the code for your `List` too. – Sunil D. Jul 05 '13 at 17:50
  • Does your custom component implement a measure method? – JeffryHouser Jul 05 '13 at 18:19
  • Until now I do not override measure method. The list caluclates its height by its default implementation. My quistion is how to override this calculation so the list caluclatetes the correct height. I do not set variableRowHeigth. Where shoud I set this variable? – Ivan Nikolov Jul 09 '13 at 10:03
  • I have also added the code that I use for the List. – Ivan Nikolov Jul 11 '13 at 07:00

0 Answers0