Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
anitha #1
problem in loading webservice data in datagrid
Hi all,
i have some problem in my application.Anybody direct me?.When i tried
to load my webservice data into datagrid control,it shows some error
"Cannot access a property or method of null object reference".What is
the problem.My source given below.
Mxml source:
[Bindable]
private var arrayData:Array;
[Bindable]
private function remotingHandler(event:ResultEvent):void
{
// Convert result to array
var answer:Array = event.result.Tables["annualresult"].Rows as
Array;
// Check the array content
if (event.result.Tables["annualresult"].Rows != null)
{
// loop to populate Dataprovider
for (var i:Number = 0; i < answer.length; i++)
{
// Fill Dataprovider attributs
arrayData[i] = {year: answer[i].year,
projected: answer[i].projected,
achieved:answer[i].achieved};
}
}
}
Mywebservice result:
<?xml version="1.0" encoding="utf-8" ?>
- <DataTable xmlns="http://tempuri.org/">
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/
XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:MainDataTable="annualresult" msdata:UseCurrentLocale="true">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="annualresult">
- <xs:complexType>
- <xs:sequence>
* <xs:element name="year" type="xs:decimal" minOccurs="0" />
* <xs:element name="projected" type="xs:decimal" minOccurs="0" />
* <xs:element name="achieved" type="xs:decimal" minOccurs="0" />
* </xs:sequence>
* </xs:complexType>
* </xs:element>
* </xs:choice>
* </xs:complexType>
* </xs:element>
* </xs:schema>
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <DocumentElement xmlns="">
- <annualresult diffgr:id="annualresult1" msdata:rowOrder="0">
* <year>2001</year>
* <projected>50000</projected>
* <achieved>30000</achieved>
* </annualresult>
- <annualresult diffgr:id="annualresult2" msdata:rowOrder="1">
* <year>2002</year>
* <projected>60000</projected>
* <achieved>80000</achieved>
* </annualresult>
- <annualresult diffgr:id="annualresult3" msdata:rowOrder="2">
* <year>2003</year>
* <projected>50000</projected>
* <achieved>40000</achieved>
* </annualresult>
- * </DocumentElement>
* </diffgr:diffgram>
* </DataTable>
By,
Anitha
anitha Guest
-
Help loading .net webservice data into flex grid -surely this is simple???!!!
Hi, Tanks for your answer, but im not seem the solution yet. I have dificult whith XML structure. My webservice return the XLM below. I need... -
Problem loading in a datagrid a xml from xmlconnector
Greetings, I hope you can help me to solve this issue, I have been trying show the childs of group in the xml in a second datagrid, and i need... -
Problem receiving data from Webservice
Hi. Like the summary says, I have set up a flash file (in the way explained below.). When I try and send and receive data, I can see the result... -
Problem loading data files having null values.
I had started another thread focussed on data truncation errors when loading my data feed. While I learned something, it didn't solve the problem.... -
Loading data from a web service into a datagrid
I am having problems loading data from a web service into a Flash datagrid component.. The web service operation returns a two-dimensional array,...



Reply With Quote

