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

When using Label in an ItemRenderer and setting paddingLeft and width, the maxDisplayedLines throws an error.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 4.0 (Release)
    • None
    • Spark: Label
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Browser: Firefox 3.x
      Language Found: English

    Description

      Hopefully I'm explaining this clearly enough... Let me know if there's anything else you need.

      Steps to reproduce:
      1. Define custom ItemRenderer for a list.
      2. CustomItemRenderer has label inside
      3. Label is 100% by 100% (height/width)
      4. Label has paddingLeft set to any non-zero value
      5. Label has maxDisplayedLines set to any non-zero value

      Actual Results:
      RangeError: Error #1125: The index -1 is out of range 0.
      at spark.components::Label/computeLastAllowedLineIndex()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\Label.as:1276]
      at spark.components::Label/truncateText()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\Label.as:1149]
      at spark.components::Label/http://www.adobe.com/2006/flex/mx/internal::composeTextLines()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\Label.as:435]
      at spark.components.supportClasses::TextBase/updateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\supportClasses\TextBase.as:570]
      at mx.core::UIComponent/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:8065]
      at mx.managers::LayoutManager/validateClient()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:931]
      at mx.core::UIComponent/validateNow()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:7249]
      at spark.components::DataGroup/initializeTypicalItem()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\DataGroup.as:247]
      at spark.components::DataGroup/ensureTypicalLayoutElement()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\DataGroup.as:266]
      at spark.components::DataGroup/measure()[E:\dev\gumbo_beta2\frameworks\projects\spark\src\spark\components\DataGroup.as:1038]
      at mx.core::UIComponent/measureSizes()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:7580]
      at mx.core::UIComponent/validateSize()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\core\UIComponent.as:7504]
      at mx.managers::LayoutManager/validateSize()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:617]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:733]
      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1069]

      Expected Results:
      Padding and setting of maxDisplayedLines to not cause runtime error.

      Workaround (if any):
      Explicitly set left instead of using padding. And must use a background rect to fill desired gap with correct color instead of relying on label background color.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: