Hi Justin, So is your goal to restore Flex 2 behavior? Honestly, I don't recall if refresh was required back then or not, but I think the code paths that require a call to refresh() after sort=null have been around as several releases.
I'd rather just make sure that there is no undesirable behavior if you do call refresh() after setting sort=null. Thoughts? On 5/15/13 9:59 PM, "Justin Mclean" <jus...@classsoftware.com> wrote: >Hi, > >> But first, let's nail this sort=null thing. I can look into it if you >> want. > >Just looking at it now. > >I've written a couple of dozen unit tests and have 3 failing in both >ApacheFlex 4.10 that I think should pass. > >Leave it with me but so you get an idea this fails with an RTE: > > addNumbers(); // adds 1 and 2 > var sort:Sort = new Sort(); > sort.fields = [new SortField(null, false, true, true)]; > ac.sort = sort; > ac.refresh(); > ac.sort = null; > addNumbers(); // adds 1 and 2 > >I'd expect this result: > assertEquals("Length is not four", ac.length, 4); > assertEquals("First element not correct", ac[0], 2); > assertEquals("Second element not correct", ac[1], 1); > assertEquals("Third element not correct", ac[2], 1); > assertEquals("Fourth element not correct", ac[3], 2); > >This also fails: > addNumbers(); // adds 1 and 2 > var sort:Sort = new Sort(); > sort.fields = [new SortField(null, false, true, true)]; > ac.sort = sort; > ac.refresh(); > ac.sort = null; > ac.removeItemAt(0); // still sorted so 2 is removed leaving 1 > >I'd expect this result: > assertEquals("First element not correct", ac[0], 1); > > >Justin