Skip navigation
Currently Being Moderated

Cusom List component and ArrayList as DataProvider

Nov 15, 2011 6:00 AM

Tags: #4.5 #custom_component #arraylist #dataprovider

Hi,

 

I have a custom List component with an ArrayList as dataProvider

 

 

<s:List id="lista" dataProvider="{listaAsset}">

 

override public function set data(value:Object):void {
  super.data = value; 
  txtOutput1.text = data.host;
  txtOutput2.text = data.ip; 
  txtOutput3.text = "Registrazioni: " + data.TotaleRegistrazioni; 
  imgoutput.source = "images/"+data.type;
  imgOs.source = "images/"+data.osUrl;
}

 

 

the list is successfully filled with the items of the ArrayList, but when I try to remove an item from the ArrayList

 

listaAsset.removeItemAt(0);

 

I receive this error:

 

 

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

at testProjInnerClass0/set data()[C:\Users\XXXXX\Adobe Flash Builder 4.5\testProj\src\testProj.mxml:179]

 

 

In debug mode the cursor is positioned to the set data function I posted above...

 

Why?

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points