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] [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard
Sent: Thursday, June 29, 2006 11:15 AM
To: [email protected]
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, "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