Error while assigning the data to dataGrid Dataprovided
Posted
by sudeep kumar
on Stack Overflow
See other posts from Stack Overflow
or by sudeep kumar
Published on 2009-06-28T17:10:36Z
Indexed on
2010/03/27
17:03 UTC
Read the original article
Hit count: 194
actionscript-3
Hi , I was trying to acces the datagrid at runtime and want to assign the data to it like
public function getGridData(reportsArray:ArrayCollection):void{
reportData = reportsArray;
trace(" The length of the datagrid is "+reportData.length);
graphDataGrid.dataProvider = reportData;
invalidateDisplayList();
}
but I was getting this error
TypeError: Error #1009: Cannot access a property or method of a null object reference. at views.charts::ComparisonAnalysis/createDataGrid()[C:\FlexProjects\AdvancedMetering\views\charts\ComparisonAnalysis.mxml:32] at views.charts::ComparisonAnalysis/getGridData()[C:\FlexProjects\AdvancedMetering\views\charts\ComparisonAnalysis.mxml:26] at components.CustomReport::CustomReportSelector/getResultHandler()[C:\FlexProjects\AdvancedMetering\components\CustomReport\CustomReportSelector.mxml:147] at components.CustomReport::CustomReportSelector/__reportingBase_dataGridResultChanged()[C:\FlexProjects\AdvancedMetering\components\CustomReport\CustomReportSelector.mxml:203] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at components.CustomReport::ReportingBase/getDataFromServer()[C:\FlexProjects\AdvancedMetering\components\CustomReport\ReportingBase.as:98] at components.CustomReport::ReportingBase/getResults()[C:\FlexProjects\AdvancedMetering\components\CustomReport\ReportingBase.as:78] at components.CustomReport::CustomReportSelector/getGraphData()[C:\FlexProjects\AdvancedMetering\components\CustomReport\CustomReportScripts.as:20] at components.CustomReport::CustomReportSelector/__getGraphandGridData_click()[C:\FlexProjects\AdvancedMetering\components\CustomReport\CustomReportSelector.mxml:248]
Can someboedy please let me know what the problem it looks like the datagrid is not instantiated at this ppoint of time
Sudee[
© Stack Overflow or respective owner