Not sure how fussy Flex is about validXML
but your fault and result attributes are in single quotes. Also the HTTPService
tag looks unclosed.
From: jivankohinoor
[mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005
4:18 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] datagrid
does not display http data
I try to fill a DataGrid from live XML data over
http, but the grid
desperately stays empty.
The code is :
<mx:HTTPService id="catalogContents"
contentType="application/xml"
method="GET" protocol="http"
resultFormat="xml"
url=""
href="http://localhost:8080/protocore/getCatalogContents">http://localhost:8080/protocore/getCatalogContents"
fault='alert(event.fault.faultstring,"",mx.controls.Alert.OK)'
result='alert("Catalog
OK","",mx.controls.Alert.OK)'>
<mx:DataGrid id="catalogGrid"
height="100%" width="100%"
dataProvider="{catalogContents.result.element}">
Returned XML is like :
<?xml version="1.0"
encoding="utf-8"?>
<elements>
<element Key="Key"
Name="Name" Dir="Dir" lang="lang"
nloc="nloc"
npar="npar"
UNKNOWN1="UNKNOWN1" UNKNOWN2="UNKNOWN2"
Status="Status"
Anom="Anom" label="label0"
/>
<element Key="BAT000000"
Name="COA034" Dir="A1/PRG" lang="Cobol"
nloc="944" npar="649"
UNKNOWN1="58" UNKNOWN2="" Status="CORRECT"
Anom="OK" label="label1" />
<element ...>
</elements>
I know that the Server part is OK, as I am able to
display raw XML
code in the following TextArea:
<mx:TextArea
text="{catalogContents.result}"/>
I tried the same, with XML compiled statically,
and it works :
<mx:Model id="catalogContentsModel"
ource="D:\\src\\Flex\\Phoenix-proto\\cataloContents.xml"
/>
<mx:DataGrid id="catalogGrid"
dataProvider="{catalogContentsModel.result.element}">
Help would be greatly needed, I tried many
different combinations of
returned XML without success (like returning
<mx:Array>/<mx:Object>
tags, specifying the object attributes as XML
attributes or as XML
elements, nothing work)
Am I *really* an idiot as I seem to be the only
one with this problem.
|