Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

DataGrid - Error #1009: Cannot access a property or method of a null object reference.

Avatar

Level 1
I am getting a runtime error when I click a button that fires
the addPerson function.

TypeError: Error #1009: Cannot access a property or method of
a null object reference.

at main/addPerson()[C:\Documents and Settings\edunn\My
Documents\Flex Builder 3\workspace2\Test-1\src\main.mxml:178]

at main/___main_Button4_click()[C:\Documents and
Settings\edunn\My Documents\Flex Builder
3\workspace2\Test-1\src\main.mxml:228]



I am new to Action Script - and object programming - so
understand...



I do not understand what I have done wrong here...



I have a result list coming from an external web service that
populates in a datagrid. I'd like to be able to update that
datagrid and then push back to the web service the new array.



Any ideas?????



import mx.rpc.events.ResultEvent;

import mx.rpc.events.FaultEvent;

import mx.collections.ArrayCollection;

import generated.webservices.FxAppiaUserFeaturesService;

import generated.webservices.UserSimRingConfig;

import generated.webservices.SimRingType;



public var plist:ArrayCollection



//Updated Function to populate the data from WS

public function
retrieveUserSimRingConfig(e:ResultEvent):void {

var UsrSimRngCfgNumList:Array = new
UserSimRingConfig().simRingNumberList;

var plist:ArrayCollection = e.result.simRingNumberList;

dgSimPhoneList.dataProvider = plist;





if (e.result.active) {

chboxSimultaneousRingPhones.selected=true;

} else {

chboxSimultaneousRingPhones.selected=false;

}



if (e.result.simRingType == "NO_RING_WHILE_ONCALL") {

chboxSimultaneousRing.selected=true;

} else {

chboxSimultaneousRing.selected = false;

}



}



// Add a person to the ArrayCollection.

public function addPerson():void {

plist.addItem({simRingNumberList:txtPhoneNumber1.text});

}



I posted this in the General Section first by
mistake...
3 Replies

Avatar

Former Community Member
Can you tell us what the exact line 178 is??





Ries

Avatar

Level 2
can u explain abt this line

var plist:ArrayCollection = e .
result.simRingNumberList;