12.07.2015 Views

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Navigation <strong>Components</strong>• Or simply execute a JavaScript expression:"javascript: alert('You clicked me!');"When providing a JavaScript expression, use double quotes to enclose the value and single quotes (if needed) insidethe expression, as shown above.7.4.2.2 Parameters for Callback MethodsA can contain zero or more elements. Each specifies an input parameter for thecallback method that generates the . This callback method might be:• OnGetNodeInfo to get data for each node within the tree.• OnGetTreeInfo to fill in a local array that supplies the contents of the tree.The element has the following attributes:AttributeparamNamevalueDescriptionThe paramName must be unique within the . It becomes a subscript in the arrayof parameters passed to the callback method.The value supplied for a can be a literal string, or it can contain a <strong>Zen</strong> #()#runtime expression.7.4.2.3 OnGetNodeInfo Callback Method can get its list of nodes by invoking a server-side callback method defined in the page class. The method nameis specified using the OnGetNodeInfo attribute. For example:This example defines a tree whose nodes are provided by the server-side callback method GetNodeInfo. When the userclicks on an item, the treeClick method is called. The example also provides two parameters for the GetNodeInfo method.The OnGetNodeInfo callback is called repeatedly to get information about each node displayed within the tree. <strong>Zen</strong> handlesthis repetition as follows:• A tree contains a set of top-level nodes at level 1. A node may contain child nodes; each child is considered to have alevel number one greater than its parent: 2, 3, 4, etc.• Starting with level 1, <strong>Zen</strong> calls the OnGetNodeInfo callback repeatedly until it returns false, indicating that there areno more nodes at the current level.• If a node reports that it has child nodes, <strong>Zen</strong> calls the OnGetNodeInfo callback repeatedly (with the appropriate valuefor pLevel) to get information on each child node until false is returned for that child level.The OnGetNodeInfo callback method must have a signature that looks like this:Method GetNodeInfo(Output tSC As %Status,ByRef pParams As %String,pLevel As %Integer,ByRef pHandle As %String,pNodeInfo As %ZEN.Auxiliary.NodeInfo) As %BooleanWhere:210 <strong>Using</strong> <strong>Zen</strong> <strong>Components</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!