Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-24208

List not sized correctly with variableRowHeights

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 4.0 (Release)
    • None
    • Layout - General
    • None
    • Affected OS(s): Mac
      Affected OS(s): Mac OS 10.6
      Browser: Safari
      Language Found: English

    Description

      Steps to reproduce:
      1. Build a list with one large item and five small items. (First item small).
      2. Build a list with one large item and five small items. (First item large).
      3. Copy 2, but set the width to cause a horizontal scroll bar.

      ------------ Application.mxml -------------
      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
      <fx:Script>
      <![CDATA[
      import mx.collections.ArrayList;
      import mx.events.ResizeEvent;
      import mx.utils.StringUtil;
      private var dp0:ArrayList = new ArrayList([

      { label: 'One', big: false }

      ,

      { label: 'Two', big: true }

      ,

      { label: 'Three', big: false }

      ,

      { label: 'Four', big: false }

      ,

      { label: 'Five', big: false }

      ,

      { label: 'Six', big: false }

      ]);

      private var dp1:ArrayList = new ArrayList([

      { label: 'One', big: true }

      ,

      { label: 'Two', big: false }

      ,

      { label: 'Three', big: false }

      ,

      { label: 'Four', big: false }

      ,

      { label: 'Five', big: false }

      ,

      { label: 'Six', big: false }

      ]);

      ]]
      >
      </fx:Script>

      <s:HGroup verticalCenter="0" horizontalCenter="0">
      <s:List dataProvider="

      {dp0}

      "
      itemRenderer="VariableHeightItemRenderer" />

      <s:List dataProvider="

      {dp1}"
      itemRenderer="VariableHeightItemRenderer" />

      <s:List dataProvider="{dp1}

      "
      width="60"
      itemRenderer="VariableHeightItemRenderer" />
      </s:HGroup>

      </s:Application>

      --------------------

      ------ VariableHeightItemRenderer.mxml -------------
      <?xml version="1.0" encoding="utf-8"?>
      <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      autoDrawBackground="true" dataChange="updateLayout()">
      <fx:Script>
      <![CDATA[
      private function updateLayout():void {
      if (data.big)

      { big.includeInLayout = true; small.includeInLayout = false; }

      else

      { big.includeInLayout = false; small.includeInLayout = true; }

      }
      ]]
      >
      </fx:Script>

      <s:Label id="big" text="Big

      {label}" top="10" bottom="10" />

      <s:Label id="small" text="Small {label}

      " top="2" bottom="2" />
      </s:ItemRenderer>

      ---------------------------------------------

      Actual Results:
      Lists are different sizes.
      #1 Is just large enough to fit the six items.
      #2 Is large enough to fit six large items. (Has extra space at the bottom)
      #3 Is just large enough to fit the six items.

      Expected Results:
      Lists should all be just large enough to fit all six items.

      Workaround (if any):
      Couldn't discover one.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: