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

ListCollectionView.getItemIndex throws RTE when the Sort's sortFields change

    XMLWordPrintableJSON

    Details

      Description

                  _sut.addAll(from4To0); //values["name"]: Object4, Object3, Object2, Object1, Object0
      
                  const sortByIndexAscending:Sort = new Sort();
                  sortByIndexAscending.fields = [new SortField("index", false, false, true)];
                  _sut.sort = sortByIndexAscending;
                  _sut.refresh(); //should be: Object0, Object1, Object2, Object3, Object4
      
                  //when
                  sortByIndexAscending.fields = [new SortField("name", false, true, false)]; //should have no effect
      
                  //then
                  assertThat(_sut.getItemIndex(from4To0.getItemAt(i)) != -1); //an RTE is thrown here
      

      Expected behaviour: the collection should resort when any of the flags of its Sort object changes, or whenever one of the flags of the Sort's SortField list changes. That, or Sort and SortField should be made immutable, to prevent this scenario in the first place.

        Attachments

          Activity

            People

            • Assignee:
              evolverine Mihai Chira
              Reporter:
              evolverine Mihai Chira
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: