1 Reply Latest reply on Nov 15, 2011 6:34 AM by Z4g0s

    Cusom List component and ArrayList as DataProvider

    Z4g0s

      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?