sebi_barzeianu
07-25-2009, 04:25 PM
Hi there!
I just started working with Adobe Flex 3, and I am trying simply to list some data from an xml file into a datagrid.
here's my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:XML id="tempXML"
source="luci.xml"/>
<mx:XMLListCollection id="myXMLList"
source="{tempXML.id}"/>
<mx:DataGrid id="dataGrid"
dataProvider="{myXMLList}"
width="100%"
rowCount="{myXMLList.length}">
<mx:columns>
<mx:DataGridColumn dataField="id"
headerText="Friends:"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
and this is the luci.xml file I am using:
<?xml version="1.0" encoding="UTF-8"?>
<ids>
<id>15302864zzz</id>
<id>21781202</id>
<id>7560872</id>
<id>47354508</id>
<id>54888349</id>
<id>56077396</id>
<id>42290523</id>
<id>22391927</id>
<id>36313301</id>
<id>22394041</id>
</ids>
when I run the code, all I get is an empty datagrid, but it has exactly 10 rows corresponding to my ids in the file (I think).
Can anyone tell me what is wrong with my code?
Thank you
I just started working with Adobe Flex 3, and I am trying simply to list some data from an xml file into a datagrid.
here's my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:XML id="tempXML"
source="luci.xml"/>
<mx:XMLListCollection id="myXMLList"
source="{tempXML.id}"/>
<mx:DataGrid id="dataGrid"
dataProvider="{myXMLList}"
width="100%"
rowCount="{myXMLList.length}">
<mx:columns>
<mx:DataGridColumn dataField="id"
headerText="Friends:"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
and this is the luci.xml file I am using:
<?xml version="1.0" encoding="UTF-8"?>
<ids>
<id>15302864zzz</id>
<id>21781202</id>
<id>7560872</id>
<id>47354508</id>
<id>54888349</id>
<id>56077396</id>
<id>42290523</id>
<id>22391927</id>
<id>36313301</id>
<id>22394041</id>
</ids>
when I run the code, all I get is an empty datagrid, but it has exactly 10 rows corresponding to my ids in the file (I think).
Can anyone tell me what is wrong with my code?
Thank you