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], "ben.clinkinbeard"
<[EMAIL PROTECTED]> 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
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to