Alex,
What if the three lists a developer is filtering/sorting are contained
within a component? Then doesn't hard coding the values into the
ModelLocator defeat the purpose of component independence? You would
have to update your model every time you wanted to add an instance of
the component,
Here's what's funny. I wasn't aware it continued to part III. Thank
you, Alex, for answering a question this silly programmer could have
found by navigating the thread. :)
Welcome to the family!
Kenny Silanskas
Director of Communications
Dillstar Productions
What is the matter with me today? Second time, I asked a question
there was a clearly published answer for. Ignore me until midnight
PST. Otherwise, who knows what chaos I could cause.
-Kenny
: [flexcoders] Re: need strategy for filtering
ArrayCollections in a Cairngorm app
To dig up an old thread... How would you go about this if you had a
component that you wanted to reuse for different views of the data
that could be filtered additionally by that view?
I've run into a similar problem Tom had
@yahoogroups.com
Subject: Re: [flexcoders] Re: need strategy for filtering ArrayCollections in
a Cairngorm app
very interesting...
why not trigger a global ArrayChangedEvent so each fitlered ArrayCollection
can update itself according to it ? (with some binding settings this should
be feasible
Of Jeremy Lu
Sent: Saturday, June 10, 2006 4:13 AM
To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
Subject: Re: [flexcoders] Re: need strategy for filtering
ArrayCollections in a Cairngorm app
very interesting...
why not trigger a global ArrayChangedEvent so each fitlered
, 2006 4:13 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a
Cairngorm app
very interesting...
why not trigger a global ArrayChangedEvent so each fitlered ArrayCollection
can update itself according to it ? (with some binding
From: flexcoders@yahoogroups.com [mailto:
flexcoders@yahoogroups.com] On Behalf Of Jeremy Lu
Sent: Saturday, June 10, 2006 4:13 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app
very interesting...
why
flexcoders%40yahoogroups.com] On
Behalf Of
Jeremy Lu
Sent: Saturday, June 10, 2006 4:13 AM
To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
Subject: Re: [flexcoders] Re: need strategy for filtering
ArrayCollections
in a Cairngorm app
very interesting...
why not trigger
Hey Tom,
In response to this question and the BindingUtils and
ArrayCollection.filter question, I offer this suggestion. In the
ModelLocator maintain a single master Array of all the users. Then
in each instance of your view components, create a new bound
ArrayCollection (dataProvider),
Thanks, Tim. That makes sense but there's one limitation I'm not sure how to work around. That master Array of users is going to be constantly updated by the server to show who's currenlty online. Since an Array isn't bindable, how would you propagate changes from that Array to the filtered
Something like this should do the trick:
mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import org.ets.main.code.model.ModelLocator;
[Bindable]
public var viewDataProvider : ArrayCollection;
viewDataProvider=new
If that doesn't work you could try this:
mx:Script
![CDATA[
import mx.collections.ArrayCollection;
import org.ets.main.code.model.ModelLocator;
[Bindable]
public var model : ModelLocator = ModelLocator.getInstance();
[Bindable]
public var viewDataProvider : ArrayCollection;
The problem is that changes to ModelLocator.getInstance().masterArray don't update the views' dataProviders. In other words, the ArrayCollections that use masterArray as their source don't know when new items are added to or removed from masterArray. That's why I was thinking that masterArray
Changes to the masterArray in the ModelLocator should be
automatically reflected in the AC if you use either of the binding
methods I posted. If not, sorry. That's all I have.
-TH
--- In flexcoders@yahoogroups.com, Tom Bray [EMAIL PROTECTED] wrote:
The problem is that changes to
Thanks for trying. An ArrayCollection will not reflect changes made directly to its source array, so new items pushed onto masterArray do not show up in my views.-TomOn 6/9/06,
Tim Hoff [EMAIL PROTECTED] wrote:
Changes to the masterArray in the ModelLocator
I'll have to take your word on that, but I'm still skeptical. If what you say is true, then you could still use the same approach, but instead have the viewlisten for updates to the masterArray in the ModelLocator. You could do this either by using the changWatcher utility or Paul Williams'
very interesting...
why not trigger a global ArrayChangedEvent so each fitlered
ArrayCollection can update itself according to it ? (with some binding
settings this should be feasible)
the trigger point is: when new data are pushed into MasterArray, dispatch it.
Tom: if you have some sample
18 matches
Mail list logo