Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34853 ListCollectionView.getItemIndex throws RTE when the Sort's sortFields change
  3. FLEX-34880

Sort and SortField state setters are now behind mx_internal and out of the interfaces

    XMLWordPrintableJSON

Details

    Description

      NOTE

      this has been placed on hold until we find a solution which doesn't break backwards compatibility

      The change

      (Both mx and spark) Sort and SortField will be transitioned to immutable objects to prevent bugs like FLEX-34853. In this step we are:

      1. removing the state setters from the interfaces (ISort and ISortField).
      2. hiding the state setters behind the mx_internal namespace. This also implies renaming them (because a getter and a setter with different namespaces throw a compile error). The pattern is: public function set compareFunction(c:Function):void becomes mx_internal function set compareFunction_(c:Function):void.

      Usage

      Before

      var sortField:ISortField = new SortField();
      sortField.name = "title";
      sortField.descending = true;
      sortField.numeric = false;
      sortField.sortCompareType = SortFieldCompareTypes.STRING;
      sortField.compareFunction = titleCompareFunction;
      

      After; Version 1 (preferred)

      var sortField:ISortField = new SortField("title", true, false, SortFieldCompareTypes.STRING, titleCompareFunction);
      

      After; Version 2 (deprecated, invalid in future versions)

      var sortField:ISortField = new SortField();
      SortField(sortField).mx_internal::name_ = "title";
      SortField(sortField).mx_internal::descending_ = true;
      SortField(sortField).mx_internal::numeric_ = false;
      SortField(sortField).mx_internal::sortCompareType_ = SortFieldCompareTypes.STRING;
      SortField(sortField).mx_internal::compareFunction_ = someCompareFunction;
      

      Attachments

        Activity

          People

            evolverine Mihai Chira
            evolverine Mihai Chira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: