Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-21 Thread Josh McDonald
And you're not getting foo is not an IEventDispatcher? What's your DateRange class extend? It may already be an EventDispatcher. I left my testbed code at work, so I can't verify it for myself :) Most intriguing though. -J On Wed, May 21, 2008 at 3:54 PM, Richard Rodseth [EMAIL PROTECTED]

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-21 Thread Richard Rodseth
Nope. No warning. DateRange doesn't extend anything. I don't know which framework class generates the warning, but I did see the following comment in ChangeWatcher.getEvents() // If host is not IEventDispatcher, no events will be dispatched, // regardless of metadata.

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Richard Rodseth
Just when I think I understand binding I believe I have the same issue described below. I have an immutable class DateRange. Surely, if I have [Bindable] public var range:DateRange; I should be able to have a binding expression {model.range.start} ? Thanks! On Thu, Jul 19, 2007 at 8:06

RE: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Alex Harui
Unless DateRenge.start is bindable, then there's no way we'd be able to see changes to it. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rodseth Sent: Tuesday, May 20, 2008 2:53 PM To: flexcoders@yahoogroups.com Subject: Re:

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Josh McDonald
Alex, if you bind to a non-bindable property on an object that is itself a bindable property (as in this case), despite the warning will the compiler generate a binding that updates when the entire object is updated? Ie will it update when range changes? Or will nothing be generated at all? On a

RE: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Alex Harui
I think it will detect changes where it can. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 20, 2008 5:10 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] unable to bind to property warnings

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Richard Rodseth
Message delivery failed. Trying again, this time with blog entry: http://flexygen.wordpress.com/2008/05/21/immutability-and-binding/ On Tue, May 20, 2008 at 7:40 PM, Richard Rodseth [EMAIL PROTECTED] wrote: Yes, but the point is that DateRange.start is not changeable - the DateRange object can

RE: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Alex Harui
Yup, that's why it is a warning. Sometimes you can ignore it. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rodseth Sent: Tuesday, May 20, 2008 9:11 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] unable to bind

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Josh McDonald
Binding to read-only accessors does work with custom events: --- testbed.xml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute xmlns:ns1=* ns1:TestBindings id=test/ mx:Label text=Testbed number is {

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Richard Rodseth
Interesting. Actually, I just did this: [Bindable(event=foo)] public function get start():Date { return _start; } without deriving from EventDispatcher (unnecessary, since I'm not dispatching anywhere), and that also worked.

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Josh McDonald
What you're doing there is just tricking the compiler into not giving you the warning, but you'll still get a run-time warning in your console. You won't get updates if start ever changes, which in your case is what you want- but if it's simply read-only rather than immutable, you'll need the call

Re: [flexcoders] unable to bind to property warnings binding to read-only properties

2008-05-20 Thread Richard Rodseth
I don't believe that's the case, Josh. I just ran it again, with [Bindable] on the start property, but not the end property, and got the warnings for end, but not for start. On Tue, May 20, 2008 at 10:30 PM, Josh McDonald [EMAIL PROTECTED] wrote: What you're doing there is just tricking the