Adam,

Thee is nothing wrong with your XML. By default, XML is handled as an array
within Flex. If you believe there to be a chance that there will be only
one element in your return you need to force the application to parse the
return into an Array.

Try this:
mx.utils.ArrayUtil.toArray(serviceObject.result.element)

Jeff

http://www.flexauthority.com



----- Original Message ----- 
From: "Adambombs" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, February 22, 2005 11:28 AM
Subject: [flexcoders] dataGrid - If only one row in xml is doesn't appear?


>
>
> The following XML is being returned by an HTTPService with
> id="leadsGridData":
>
> <?xml version="1.0" encoding="utf-8"?>
> <response>
> <leaddata>
> <range>12/1/2004 to 12/31/2004</range>
> <leads>
> <lead>
> <quoteid>12345</quoteid>
> <date>12/12/2004</date>
> <name>Joe</name>
> <city>Smith</city>
> <state>ca</state>
> </lead>
> </leads>
> </leaddata>
> </response>
>
> The dataProvider on the grid is set to:
> {leadsGridData.response.leaddata.leads.lead}
>
> If there is only one lead node it won't show up in the dataGrid, if
> there are two or more nodes all of the nodes will show in grid.
>
> I am an XML newbie, is there something wrong with the XML?
>
> Thanks for any help,
>
> Adam
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>



Reply via email to