The AdvancedTree's memory is a useful feature when you need to repopulate the tree after some external manipulation and you need it to remain at its current state of opened and closed nodes. For instance, if an AdvancedTree instance is populated with XML sent from a server, the user manipulates the nodes in the component, the XML is sent to the server for modification, then the component needs to be refreshed with the result, ideally you would want the tree to remain in its current visual state, which means nodes that are opened would remain open and nodes that are closed would remain closed. This can be accomplished by using the memory facility.
This functionality is only useful when the XML you are repopulating the tree with is the same form as the XML previously displayed in the tree. This is because the memory facility works by storing the levels and indices of the current nodes and attempting to reopen the nodes to the same state when then tree is refreshed with new XML. If the XML is different, then the memory fails.
The basic steps are that the tree is instructed to save its current state, then if the tree is repopulated with new data it will then attempt to apply its memory to the new data, opening the necessary nodes to reach the same visual state.
Instruct an AdvancedTree instance to save its current state.
// tree's memory is populated with its current state
tree.saveCurrentState();
Repopulate the AdvancedTree instance with new data. If the XML is similar enough, the visual state will be maintained.
// tree is repopulated with new data
tree.populate(newXML);