Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Apache Flex 4.15.0
-
None
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:
- removing the state setters from the interfaces (ISort and ISortField).
- 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;