Interesting... I'd be curious how the curly-brace syntax translates to AS3. There are watchers for XML in the mx.binding.* package. Perhaps they are automatically used? They work by basically injecting some stuff into the XML object's prototype... which is a cool way to retrofit a built-in class! ;-)
It'd be great to see some more detailed explanation of this from Adobe... at the very least, some commitment to intended behavior that we can depend on (as opposed to this being some kind of happenstance side-effect). It would be very handy to have a nice fat XML document that I could modify at will and have various bindings update auto-magically. Troy. On 3/8/07, Tracy Spratt <[EMAIL PROTECTED]> wrote:
Ok, in my case, the problem was solved by casting (or top level function conversion, or whatever it really is). In the repeater, this produced the warnings: myProperty'[EMAIL PROTECTED]' This should have been expected, since currentItem is type Object, and we know better than to bind to that. The fact that the compiler recognized and reported the correct contained class as 'XML' led me astray. This corrects the warnings: myProperty'{XML(myRepeater.currentItem)[EMAIL PROTECTED]' And a related note, the XML class does definitely dispatch the events to support binding. My search of the documents however did not turn up any definitive statement to that effect. In fact, there are contradictory statements. If I have time I will continue to investigate the docs. I have posted my XMLBinding proof app on cflex if anyone cares. Tracy ------------------------------ *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Tracy Spratt *Sent:* Wednesday, March 07, 2007 7:32 PM *To:* flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] Re: Another data binding question - "on class 'XML' (class is not an IEventDispa I don't think that is correct. The XML class does dispatch the events necessary for binding. I'll look for the doc reference in a bit. Tracy ------------------------------ *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Troy Gilbert *Sent:* Wednesday, March 07, 2007 6:44 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Re: Another data binding question - "on class 'XML' (class is not an IEventDispa It may be working so far because the objects you set your XML as a dataProvider are wrapping it as an XMLListCollection or similar, which will provide notification mechanisms. The XML class as-is can't participate in binding as it doesn't dispatch events (which is required for binding). Troy. On 3/7/07, *Tracy Spratt* <[EMAIL PROTECTED]> wrote: That fix seems to apply to objects in a collection or array. How do I apply it to xml attributes? And again, is it a valid warning? Or can it be ignored. The bindings seem to work (so far) Tracy ------------------------------ *From:* [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] *On Behalf Of *coderjun *Sent:* Tuesday, March 06, 2007 9:28 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Re: Another data binding question - "on class 'XML' (class is not an IEventDispa All, I was troubleshooting this binding warning the other day myself and ran across this blog - that at least in my case - addressed the issue, complete with a detailed explanation and code examples. The key is using an ObjectProxy. http://blog.wheelerstreet.com/?p=16 I hope that helps. -Jun --- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > Correction, the warnings do show up in FB after all. > > Tracy > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of Tracy Spratt > Sent: Tuesday, March 06, 2007 1:11 PM > To: flexcoders@yahoogroups.com > Subject: RE: [flexcoders] Another data binding question - "on class > 'XML' (class is not an IEventDispatcher)" > > > > Hey, Julien, did you figure this out yet? I just noticed it in my trace > log. And oddly, I do not get the warnings in FlexBuilder. > > > > Perhaps it is a spurious warning? The archives don't show any definitive > solution. I'm still looking. > > > > Tracy > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of julien castelain > Sent: Friday, March 02, 2007 1:20 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Another data binding question > > > > Hi list, > > I have a DataGrid in my application that gets populated from an XML > file. Displaying the data in the grid 'as text' works fine, but I > wanted to use an item renderer, as soon as I do this I get this warning > : > > "warning: unable to bind to property 'icon' on class 'XML' (class is > not an IEventDispatcher)" > > How can I get rid of that warning? Do I have to cast the XML to some > other class, and how could I do this? > > Thanks for your help. > > Julien >