TreeNode::findNode Method

Returns a specified node in the Application Object Tree (AOT).

Syntax

client server public static TreeNode findNode(str path)

Run On

Called

Parameters

  • path
    Type: str
    A string that indicates the path that is used in the search.

Return Value

Type: TreeNode Class
The requested TreeNode object or nullNothingnullptrunita null reference (Nothing in Visual Basic) if no node with the specified path exists.

Remarks

Another way of getting a TreeNode object is by using the Info.getNode method. An important difference between the two methods is that the Info.getNode method will give you a node that is detached from the AOT, whereas the findNode method will return the node in the AOT. This means that the node that is returned by the Info.getNode method will not have a parent node, whereas the one returned by the findNode method will have a parent node.

Examples

The following example retrieves the name of the tree node that is found the TreeNode::findNode method is called. This example checks whether the user has the required security key before it calls the TreeNode.findNode method.

server static public void Main(Args _args) 
{ 
    TreeNode tn; 
    str name; 
  
    tn = TreeNode::findNode(@"\Classes"); 
    if (tn) 
    { 
        name = tn.treeNodeName(); 
    } 
}

See Also

TreeNode Class

xInfo.getNode Method

TreeNode.getNodeInLayer Method