Alex, thank you for your response - it makes sense now. I still have some
fuzziness about multiple array collections against a common source... Do I
have the following correct??
Say, I have an array named SourceArray and an ArrayCollection named
SourceAC, sourced from SourceArray. And, to complete my situation, I have
two other ArrayCollections also sourced from SourceArray. One collection is
filtered ("FilterAC") and another is sorted ("SortAC"). The user is seeing
a list provided by FilterAC and another list provided by SortAC. The user
can select items from either list for editing or removal, and can also
signal to add to either list. To support these adds, edits and removes, I
operate against SourceAC - not FilterAC or SortAC. As my code makes changes
to items in SourceArray via SourceAC,
these changes are immediately reflected in the filtered collection and in
the sorted collection, with corresponding filters and sorts applied
spontaneously, i.e. I do not have to issue a refresh for the filter or
reapply the sort. Do I have this correct?? If this is really true, where
do we make sacrifices to the Flex Gods??
Again, thank you for your time. I scan my Flexcoders mail every day - your
feedback is invaluable.
_____
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Friday, December 14, 2007 2:14 AM
To: [email protected]
Subject: RE: [flexcoders] Flex newbie has ICollectionView confusion...
Adding or removing from a sorted or filtered view is problematic whether you
use IList or IViewCursor.
Let's say I have numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
I filter for only multiples of 3: 3, 6, 9, 12
If I then call addItemAt(99, 1), where should it go? Somewhere between 3
and 6, but where? Before 4? 5? 6?
Depending on your scenario, you may want to manipulate an unfiltered,
unsorted list that shares the same source as the sorted/filtered collection.
_____
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Anita Karst
Sent: Thursday, December 13, 2007 3:12 PM
To: [email protected]
Subject: [flexcoders] Flex newbie has ICollectionView confusion...
Hello Flexcoders,
I apologize if this is a question that has already been beat to death - but
I can't seem to find anything explicit about this.
In the Flex documentation under the topic "Using IList interface methods and
properties", there is a clearly marked note that says.
"If you use the ICollectionView interface to sort or filter a collection, do
not use the IList interface to manipulate the data, as the results are
indeterminate."
So, to make sure I understand, if you have an array collection that has been
sorted and/or filtered, you can not then subsequently use the easy IListlist
methods (i.e. addItemAt, getItemAt, setItemAt, etc.) successfully against
this collection. As I understand, to alter an item in this collection, you
need to use the less-obvious IViewCursor methods of
remove-coupled-with-insert to alter an item in the collection. Am I on the
right track here? Or, is there some other best-practice?
Thanks for your time,
Anita