[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-12-09 Thread lostinrecursion
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,

[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-12-09 Thread Kenny Silanskas
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

[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-12-09 Thread lostinrecursion
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

Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-12-06 Thread Rick Schmitty
: [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

Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-12-05 Thread Rick Schmitty
@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

RE: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-12-05 Thread Alex Uhlmann
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

RE: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-10 Thread Paul Williams
, 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

Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-10 Thread Tom Bray
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] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-10 Thread Tim Hoff
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

[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tim Hoff
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),

Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tom Bray
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

[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tim Hoff
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

[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tim Hoff
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;

Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tom Bray
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

[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tim Hoff
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

Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tom Bray
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

[flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Tim Hoff
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'

Re: [flexcoders] Re: need strategy for filtering ArrayCollections in a Cairngorm app

2006-06-09 Thread Jeremy Lu
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