bosewicht
04-30-2009, 08:25 PM
I am using some example flex code to populate datagrids but there seems to be a problem somewhere. My asmx page is working fine, but the flex code below doesn't seem to get the xml data. Can anyone help?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();" layout="absolute">
<mx:Script>
<![CDATA[
//Run once Flex has loaded
private function init():void
{
//Send Get Request to .NET Web Service
yourWebServiceID.getDataXML.send();
}
]]>
</mx:Script>
<mx:WebService id="yourWebServiceID" wsdl="http://myWebService/Summary.asmx" showBusyCursor="true">
<mx:operation name="getDataXML" resultFormat="e4x">
<mx:request>
<strQuery>
SELECT * FROM MyTable ORDER BY myField
</strQuery>
<strRootNode>root</strRootNode>
<strItemNode>item</strItemNode>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:DataGrid width="100%" height="100%" dataProvider="{yourWebServiceID.getDataXML.lastResult.root.item}"/>
</mx:Application>
ok, so debugging i get
warning: unable to bind to property ‘root’ on class ‘XMLList’ (class is not an IEventDispatcher)
warning: unable to bind to property ‘item’ on class ‘XMLList’ (class is not an IEventDispatcher)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();" layout="absolute">
<mx:Script>
<![CDATA[
//Run once Flex has loaded
private function init():void
{
//Send Get Request to .NET Web Service
yourWebServiceID.getDataXML.send();
}
]]>
</mx:Script>
<mx:WebService id="yourWebServiceID" wsdl="http://myWebService/Summary.asmx" showBusyCursor="true">
<mx:operation name="getDataXML" resultFormat="e4x">
<mx:request>
<strQuery>
SELECT * FROM MyTable ORDER BY myField
</strQuery>
<strRootNode>root</strRootNode>
<strItemNode>item</strItemNode>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:DataGrid width="100%" height="100%" dataProvider="{yourWebServiceID.getDataXML.lastResult.root.item}"/>
</mx:Application>
ok, so debugging i get
warning: unable to bind to property ‘root’ on class ‘XMLList’ (class is not an IEventDispatcher)
warning: unable to bind to property ‘item’ on class ‘XMLList’ (class is not an IEventDispatcher)