Hello everybody,
I am using adobe flash builder to create a widget. The widget should load a datagrid with the data retrieved by ASP.NET, but when I click the widget, it keeps loading.
My code is as the following:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
public function init():void {
// Get Data from WebService and fill datagrid when you first invoke the application
ws.GetLoc();
}
public function GetLoc(event:ResultEvent):void {
// Databind data from webservice to datagrid
datagrid.dataProvider = event.result;
}
public function fault(event:FaultEvent):void {
// Oppps some error occured
Alert.show(event.toString());
}
]]>
</mx:Script>
<mx:WebService id="ws" wsdl="http://localhost/TestWebService/Service.asmx?WSDL" fault="fault(event)">
<mx:operation
name="GetLoc"
resultFormat="object"
result="GetLoc(event)"
/>
</mx:WebService>
<mx:Panel x="41.5" y="66" width="714.5" height="237" layout="absolute" title="Results">
<mx:HBox height="95%" width="95%" horizontalCenter="0" verticalCenter="0">
<mx:DataGrid id="datagrid" width="680" height="100%">
<mx:columns>
<mx:DataGridColumn headerText="Item No" dataField="ItemNo"/>
<mx:DataGridColumn headerText="Sub Type No" dataField="SubTypeNo"/>
<mx:DataGridColumn headerText="Item Name" dataField="ItemName"/>
<mx:DataGridColumn headerText="Arrival Date" dataField="ArrivalDate"/>
</mx:columns>
</mx:DataGrid>
</mx:HBox>
</mx:Panel>
</mx:Application>
No idea on it, is there anything wrong with my code? I am using Adobe flash builder 4.6
Thanks a lot.
Message was edited by: Robert Scheitlin, GISP