Example name: Flex Tree View with Remote Data
Description: The example demonstrates the following:
  • Usage of Flex Remoting to populate tree view control with a remote set of data
  • Mapping hierarchical server-side data model to the client objects
  • Lazy (delayed) data loading of tree view
Client-side code: Browse  Download
Server-side code: Browse  Download
Run example:
Key points:
  • Server-side class returns a hierarchy of folders and files, one level at a time. The model of the value objects is as shown below:

    The client-side object model directly maps with the one from the server. So the client code does not need to do anything special to recreate the data model other than map the server classes to the ones on the client.

  • Since there is no XML involved in rendering the data in the tree control, the code uses a custom implementation of ITreeDataDescriptor (see the FileSystemTreeDataDescriptor class)
  • There are two event handlers registered with the tree view to handle lazy node initialization. See the "change" and "itemOpenning" events (implemented in the handleTreeChange and handleRetrieve methods)