Sanjay Minni wrote:
> self listComponent
> sortBlock: [:items |
> items sortBy: [:a :b | a deadline < b deadline]];...
If you add a loose method something like:
sortBy: a2Block
^ (self asSortedCollection: a2Block]) asOrderedCollection.
to class SequencableCollection then you'll get the behaviour of the
Pharo/Squeak #sortBy:
FWIW, in Pharo Collection>>sortBy: has been deprecated for some time (I think
replaced by Collection<<sorted:), and of course it doesn't exist in Dolphin at
all, so you may be better off chosing your own idiom and using that.
Anyway, the idea is to get a new collection which is sorted, but isn't actually
a SortedCollection. The difference (which may or may not be important for your
code, or for Seaside) is that adding new elements won't automatically sort them
into the correct position.
-- chris