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

Setting selectedItem to null value in Spark List causes error when data provider is a sorted ListCollectionView

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • Adobe Flex SDK Previous
    • None
    • Spark: List
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      A spark list using a sorted ArrayCollection (or any class that extends from ListCollectionView) throws an error if the selectedItem property is set to null.

      Steps to reproduce:
      1. Compile the attached Main.mxml application
      2. Click the button "Select null"

      The stack trace of the resulting error is:

      TypeError: Error #2007: Parameter string1 must be non-null.
      at flash.globalization::Collator/compare()
      at spark.globalization.supportClasses::CollatorBase/compare()[E:\dev\hero_private\frameworks\projects\spark\src\spark\globalization\supportClasses\CollatorBase.as:620]
      at spark.collections::SortField/stringCompare()[E:\dev\hero_private\frameworks\projects\spark\src\spark\collections\SortField.as:874]
      at spark.collections::Sort/internalCompare()[E:\dev\hero_private\frameworks\projects\spark\src\spark\collections\Sort.as:918]
      at spark.collections::Sort/findItem()[E:\dev\hero_private\frameworks\projects\spark\src\spark\collections\Sort.as:621]
      at mx.collections::ListCollectionView/http://www.adobe.com/2006/flex/mx/internal::findItem()[E:\dev\hero_private\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:1172]
      at mx.collections::ListCollectionView/getItemIndex()[E:\dev\hero_private\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:652]
      at spark.components.supportClasses::ListBase/commitProperties()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\supportClasses\ListBase.as:925]
      at spark.components::List/commitProperties()[E:\dev\hero_private\frameworks\projects\spark\src\spark\components\List.as:1069]
      at mx.core::UIComponent/validateProperties()[E:\dev\hero_private\frameworks\projects\framework\src\mx\core\UIComponent.as:8209]
      at mx.managers::LayoutManager/validateProperties()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\LayoutManager.as:597]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\LayoutManager.as:813]
      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]

      A workaround is to set the selectedIndex property to -1 instead of using the selectedItem property.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: