I’ll forward your thanks on to Basil, Paul, et. al. :)

 

Hmm, it is supposed to work at the operation level too… since it is a boolean property and can’t be undefined or null it tries to keep track of whether it was set locally or whether it has to check with its parent service for its setting. The default is true at any level.

 

Pete

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Kelly Birr
Sent: Thursday, June 29, 2006 3:54 PM
To: [email protected]
Subject: RE: [flexcoders] Re: Flex 2 final release - Change in parsing of WebService results... again

 

First of all I would like to thank Pete and the Flex team for what is probably the best data binding implementation I've seen anywhere.  I love the open event-based structure of it that has enabled me to hook into it to create some very cool change-tracking utilities.  Again Thank You!

 

I was also curious as to what the makeObjectBindable property on the <mx:operation> element is for?  It does not seem to allow me to enable/disable this feature on a per-operation bases.  I've tried setting it to false on the WebService and arrays come in as arrays as expected.  However if it set it only in the operation and leave it default on the webservice they come in as array collections.  Am I missing something?

 

- Kelly

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Farland
Sent: Thursday, June 29, 2006 11:33 AM
To: [email protected]
Subject: RE: [flexcoders] Re: Flex 2 final release - Change in parsing of WebService results... again

The “data binding” feature in MXML works through a system event types and handlers. When a property changes it notifies listeners (who registered event handlers) that it a property has changed. Data binding allows you to link two values so that if one changes, the other is informed about it and changes its value too (and with a little more code you can get the other way to work too for two-way binding).

 

However, the intrinsic types Object and Array from ActionScript are not inherently bindable as they don’t report change events. A wrapper class like ObjectProxy class attempts provide these change events for you but also appears as if it were the underlying wrapped instance through the magic of flash.utils.Proxy (which allows it to intercept all operations on an object… except, unfortunately, getQualifiedClassName and describeType, so you can’t hide its class name). The equivalent wrapper for Array is mx.collection.ArrayCollection (although this has a multitude of other uses too).

 

The fact that it didn’t work in your case below is curious…

 

Pete

 

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard
Sent: Thursday, June 29, 2006 1:58 PM
To: [email protected]
Subject: [flexcoders] Re: Flex 2 final release - Change in parsing of WebService results... again

 

Thanks Peter, setting makeObjectsBindable to false worked like a
charm. Can you explain a bit about what exactly that does? From your
description of ObjectProxy it sounds like I shouldn't need to change
makeObjectsBindable so I am a bit confused. As I said, it is fixed so
this inquiry is purely academic. Thanks again.

Ben

--- In [EMAIL PROTECTED]ups.com, "Peter Farland" <[EMAIL PROTECTED].> wrote:
>
> We had feedback asking for WebService.makeObjectsBindable to work for
> Object and Array in Beta 3, so we made this change for final. It was
> also set to true by default. You can either set the makeObjectsBindable
> attribute to false, or dig in to see why you're getting this error.
>
>
>
> mx.utils.ObjectProxy is a subclass of flash.utils.Proxy, so it should
> intercept all calls to the wrapped object and pass them on through as if
> it were the object there itself. Also note that because you probably
> have an Array somewhere it too would be wrapped, but in an
> mx.collections.ArrayCollection (since Array is not bindable)?
>
>
>
> Also, if you think there is a bug, the best thing you can do is get a
> reproducible case together and log a bug or at least zip it up (rename
> the zip extension to .zp) and email it to an Adobe employee (I can take
> a look if you email it to me).
>
>
>
> Pete
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com] On
> Behalf Of ben.clinkinbeard
> Sent: Thursday, June 29, 2006 11:15 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] Flex 2 final release - Change in parsing of
> WebService results... again
>
>
>
> It looks like, once again, the way WebService results are parsed into
> objects has changed. This is getting quite frustrating. As you can see
> below, the way to access data in an ArrayCollection was changed from
> B2 to B3, and now it seems to have changed again. In my labelFunction,
> here is the code I have to use to see if there are multiple child
> objects inside my AC:
>
> Final release code:
> if(obj_data[0].Plans[0].PlanNumber != undefined)
> {
> str = obj_data[0].Plans[0].PlanNumber;
> }
>
> Beta 3 code:
> if(obj_data.Plans.length == 1)
> {
> str = obj_data.Plans[0].PlanNumber;
> }
>
> Using the B3 code in the final release I get an error saying there is
> no property named 'Plans'. Looking in the debugger shows that obj_data
> has a property named [0] of type mx.utils.ObjectProxy, which in turn
> holds a property named 'Plans'. Shouldn't I be able to transparently
> access this by with the obj_data.Plans syntax?
>
> What is going on here? Why does this behavior keep changing?
>
> --- In [EMAIL PROTECTED]ups.com <mailto:flexcoders%40yahoogroups.com>
> , "ben.clinkinbeard"
> <ben.clinkinbeard@> wrote:
> >
> > Hello, I am having some strange issues moving from B2 to B3 that I
> > can't seem to find dosumented anywhere. It seems that the objects
> > created from my WS results are being parsed differently. For instance,
> > here is some return xml.
> >
> > <Client>
> > <EnterpriseId>99999</EnterpriseId>
> > <ClientName>Film Ltd.</ClientName>
> > <Plans>
> > <Plan>
> > <PlanNumber>55555</PlanNumber>
> > <PlanName>RETIREMENT SAVINGS PLAN</PlanName>
> > </Plan>
> > </Plans>
> > </Client>
> >
> > Depending on the data, there can sometimes be multiple Plan nodes. My
> > code in B2 to check and deal with this was:
> >
> > if(obj_data.Plans.Plan.PlanNumber != null)
> > {
> > str = obj_data.Plans.Plan.PlanNumber;
> > }
> > else
> > {
> > var i:Number = 0;
> > while(obj_data.Plans.Plan[i] != null)
> > {
> > str += (str.length > 0) ? "\n" : "";
> > str += obj_data.Plans.Plan[i].PlanNumber;
> > i++;
> > }
> > }
> >
> > but in B3 that throws an error. Something about obj_data.Plans.Plan
> > being undefined. In B3 I have to change the code to:
> >
> >
> > if(obj_data.Plans.length == 1)
> > {
> > str = obj_data.Plans[0].PlanNumber;
> > }
> > else
> > {
> > var i:Number = 0;
> > while(obj_data.Plans[i] != null)
> > {
> > str += (str.length > 0) ? "\n" : "";
> > str += obj_data.Plans[i].PlanNumber;
> > i++;
> > }
> > }
> >
> >
> > I am also having problems displaying WS results in other places in my
> > app. Did something change in B3 concerning how XML and/or WS responses
> > are parsed into objects?
> >
> > Thanks,
> > Ben
> >
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to