1 Reply Latest reply on Dec 18, 2007 1:59 AM by zorglub76

    Lazy-load tree

      Hi all

      I'm trying to create a tree that uses lazy-load to get the children of the branch. My data is in JSON format and looks like this:
      [ {"id":"12345", "text":"Label of the node", "leaf":"false"}, ....... ]

      So, I wanted to check the "leaf" property to see weather this node has children. For a start, I created my own data descriptor that has overriden functions isBranch() and hasChildren(), which always return true. But I always received the following exception:
      TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::Tree/::isBranch()

      Since previously, with default data descriptor I always received the data, I decided to copy/paste the DefaultDataDescriptor class code into my .as file and then change it. But I'm still getting the same error although I changed nothing from original DefaultDataDescriptor (except name/constructor and package).

      Is there any tutorial on this? Anyone has any idea what I'm doing wrong?

      Thanks in advance.