Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Troy Gilbert
> I'm fascinated by what makes sense declaratively, and what doesn't. Flex is > a great playground for the two styles. That's exactly why I (and likely you) found the AS3-based event handler method distasteful (from your original post): you're forced to do something best expressed declaratively in

Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Richard Rodseth
No problem. I'm glad someone else thinks it might be useful. I could even imagine a variation that had multiple handlers, or passed the event to the handler. I'm fascinated by what makes sense declaratively, and what doesn't. Flex is a great playground for the two styles. On Thu, Aug 14, 2008 at

Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Troy Gilbert
> I don't believe either of them would call a function when the contents of a > collection changes (as opposed to the collection itself). The modification > Dennis offered would. Sorry, completely missed the point, didn't I? ;-) You're right, what you're looking for would be useful as well! ;-) I'

Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Richard Rodseth
Not sure I understand what you're responding to. I agree about the usefulness of the tags. I don't believe either of them would call a function when the contents of a collection changes (as opposed to the collection itself). The modification Dennis offered would. On Thu, Aug 14, 2008 at 10:37 AM

Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Troy Gilbert
To repeat what someone said earlier, this exact issue is already addressed quite cleanly by the aforementioned Observe tag (and it's more advanced version ObserveValue). I think the Observe/ObserveValue tags are easily useful enough that their inclusion in BindingUtils (or wherever mx:Binding is k

Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Daniel Gold
should all be based on property change events, the heart of binding On Thu, Aug 14, 2008 at 8:55 AM, Richard Rodseth <[EMAIL PROTECTED]> wrote: > Oh, I just stepped through Observe, and I guess the standard binding > mechanism calls the source setter again, which calls the handler. > > > On Thu

Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Richard Rodseth
Oh, I just stepped through Observe, and I guess the standard binding mechanism calls the source setter again, which calls the handler. On Thu, Aug 14, 2008 at 6:49 AM, Richard Rodseth <[EMAIL PROTECTED]> wrote: > Thanks guys. > > Can someone explain how ac:Observe (which this is based on) works?

Re: [flexcoders] Re: Observing collections

2008-08-14 Thread Richard Rodseth
Thanks guys. Can someone explain how ac:Observe (which this is based on) works? i.e. what triggers the handler call when somethng in the middle of the source binding expression changes (eg. "b" in "{a.b.c.myCollection}"? I don't see any event handlers, and there's a mysterious execute() method in

[flexcoders] Re: Observing collections

2008-08-14 Thread Dennis van Nooij
try this: package com.adobe.ac { import mx.events.CollectionEvent; import mx.collections.ArrayCollection; import flash.events.Event; import mx.core.Application; import mx.core.UIComponent; /** * * monitors Collect

Re: [flexcoders] Re: Observing collections

2008-08-13 Thread Richard Rodseth
As far as I recall mx:Binding just invokes a setter (for the destination property) and I'm pretty sure it doesn't watch CollectionChanged either. On Wed, Aug 13, 2008 at 8:42 PM, Amy <[EMAIL PROTECTED]> wrote: > --- In flexcoders@yahoogroups.com , > "Richard Rodseth" <[EMAIL PROTECTED]> > wrote

[flexcoders] Re: Observing collections

2008-08-13 Thread Amy
--- In flexcoders@yahoogroups.com, "Richard Rodseth" <[EMAIL PROTECTED]> wrote: > > A little more context. I'm working on a view that builds itself dynamically > (adding children to various containers) based on a description. > > So suppose my view has a property called "description" which has a