Joe, in addition to what Tracy mentions, you have some case-sensitivity problems. All your XML element names are lower case, so you must write

 

... source="{GetData.product}" ...

... dataField="name" ...

... dataField="description" ...

... dataField="price" ...

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Tracy Spratt
Sent: Monday, July 24, 2006 10:39 AM
To: [email protected]
Subject: RE: [flexcoders] A very simple XML question

 

I believe the XML object will already be at the root so try:

source="{GetData.Product}"

 

If you still have trouble, use a test function to inspect the structure of the GetData object.  Use toXMLString() to see the xml.

 

Tracy

 


From: [email protected] [mailto:[email protected]] On Behalf Of Joe
Sent: Sunday, July 23, 2006 10:49 AM
To: [email protected]
Subject: [flexcoders] A very simple XML question

 

Hi all,
I'm very new to Flex so I started to read all the Doc. and Samples
under the HELP Section.
Now I'm just trying - with no luck - to import from a local xml
file some data.

here is my little listino.xml file - saved at the same level of the
main file named c.mxml.

========= listino.xml =========
<?xml version="1.0" encoding="utf-8"?>
<catalog>
<product>
<name>blablabla</name>
<description>blebleble</description>
<price>99.99</price>
</product>
<product>
<name>blablabla</name>
<description>blebleble</description>
<price>100.99</price>
</product>
</catalog>
========================

Then , here is my c.mxml file.
========= c.mxml =========
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="600" height="450">
<mx:Model id="GetData" source="listino.xml" />

<mx:ArrayCollection id="ac"
source="{GetData.Catalog.Product}" />
<mx:DataGrid id="dg" dataProvider="{ac}" >

<mx:columns>
<mx:DataGridColumn headerText="Name"
dataField="Name" width="120" />
<mx:DataGridColumn
headerText="Descrption" dataField="Description" width="250" />
<mx:DataGridColumn
headerText="Price" dataField="Price" width="150" />
</mx:columns>

</mx:DataGrid>

</mx:Application>

==========================

If I run it, I get no errors but no data at all.
Any suggestion?

Thank you in advance for your help.
Kind Regards

joe

__._,_.___

--
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




__,_._,___

Reply via email to