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

removeAll() on a sorted ArrayCollection returns a RangeError: Index '-1'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 4.1 (Release)
    • Apache Flex 4.10.0
    • Collections
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      We are seeing this bug as well in SDK 4.1. As comments in the original bug stated, the internal list is not synchronized with the ArrayCollection.

      We have a DataGrid displaying a collection of objects in an ArrayCollection. When we sort the values in the datagrid, we get the error "Index '-1' specified is out of bounds" on calls to arrayCollection.removeAll().

      Possibly relevant: had set arrayCollection.disableAutoUpdate() before calling removeAll().

      original bug:
      ----------------------------

      Steps to reproduce:
      1. Create a sorted ArrayCollection
      2. example: this._mySortedArrayCollection.sort = myAlphaSort;
      3. populate the array and then remove any valid item with "removeItemAt"

      Actual Results:
      RangeError: Index '-1' specified is out of bounds.
      at mx.collections::ArrayList/removeItemAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\collections\ArrayList.as:358]
      at mx.collections::ListCollectionView/removeItemAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:601]
      ...
      The RangError always says "Index '-1'" not matter what index value is entered. For example this._mySortedArrayCollection.removeItemAt(7); with return the above same RangeError saying "Index '-1'"

      Expected Results:
      The item at the selected index should be removed from the ArrayCollection

      Workaround (if any):
      None

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: