1 Reply Latest reply on Oct 4, 2007 9:12 AM by Trugriff

    When trying to selectIndex results in #1009: Cannot access a property or method of a null object reference.

    Trugriff
      I have a custom component that contains a List control. It has a data provider that is an ArrayCollection from a web service.

      When a user adds a new item to that list, I want to scroll to the index of the added item & highlight it.

      When I do this from my mxml file, I get

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

      here is the code that throws the error: (navigator is id of custom component)

      currJob.jobComponents = ArrayCollection(ev.result);
      navigator.componentList = currJob.jobComponents; //data provider for List Control being set with results of Web Service Call
      navigator.compList.selectedIndex = currJob.jobComponents.length-1; //this is the code that generates error.

      HELP!
      Thanks