Portlet Factory, Version 6.1.2
Customizing the Tree Display
This XML structure controls the display of the Employees and Employee nodes for a tree structure.
<TreeStyle> <DefaultNodeStyle> <Images> <OpenedNodeImage>../../factory/images/tree/opennode.gif</OpenedNodeImage> <ClosedNodeImage>../../factory/images/tree/closednode.gif</ClosedNodeImage> <LeafNodeImage>../../factory/images/tree/leafnode.gif</LeafNodeImage> </Images> <Caption>default^text</Caption> <Data>default^nodeNamePath</Data> </DefaultNodeStyle> <NodeStyle> <TagName>Employees</TagName> <Images> <OpenedNodeImage>../../factory/images/tree/opennode.gif</OpenedNodeImage> <ClosedNodeImage>../../factory/images/tree/closednode.gif</ClosedNodeImage> <LeafNodeImage>../../factory/images/tree/leafnode.gif</LeafNodeImage> </Images> <Caption>const^Employee List</Caption> <Behaviors> <Behavior> <Event>onclick</Event> <Trigger>LJOName.showClickInfo</Trigger> <Target>_self</Target> <ClientTrigger>alert('caught an employee click');</ClientTrigger> </Behavior> </Behaviors> </NodeStyle> <NodeStyle> <TagName>Employee</TagName> <Images> <OpenedNodeImage>../../factory/images/tree/opennode.gif</OpenedNodeImage> <ClosedNodeImage>../../factory/images/tree/closednode.gif</ClosedNodeImage> <LeafNodeImage>../../factory/images/tree/leafnode.gif</LeafNodeImage> </Images> <Caption>path^Name</Caption> <ItemList listtype="include"> <Item nodename="Address"/> <Item nodename="City"/> <Item nodename="State"/> </ItemList> <Data>path^State</Data> </NodeStyle> <TreeStyle></TreeStyle>The following table describes each of elements used in a structure.
Table 1. Customizing the Tree Display Element Used for specifying... <OpenedNodeImage /> The image to display for opened nodes. <ClosedNodeImage /> The image to display for closed nodes. <LeafNodeImage /> The image to display for leaf nodes (nodes without children). <ItemList /> A list of child elements to display, or to keep from being displayed, under the node. <Caption /> The text to display for the node. <Behaviors /> The method to run or the JavaScript to execute when the user clicks on the node. <Data /> The input value when the node is selected.
<Caption /> Options
Table 2. <Caption /> Options Desired Display Value of <Caption /> Element Text value for the node default^text XML tag for the node default^tag XML tag and text value for the node default^tagtext The text value for a child of the node path^XPath/to/child -- Where XPath/to/child is an XPath notation that points to a text value in the XML structure of the tree. Note: XPaths are relative from the current node.
Constant Value const^Value – Where Value will be displayed for any occurrences of this node in the tree.
<Behaviors /> Options
Table 3. <Behaviors /> Options Desired Action Value for <Behaviors /> Element Execute an Action List, Method, or LJO method <Behaviors> <Behavior> <Event></Event> <Trigger>LJOName.methodName</Trigger> <Target>_self</Target> <ClientTrigger></ClientTrigger> </Behavior> </Behaviors>Execute client-side JavaScript <Behaviors> <Behavior> <Event>onclick</Event> <Trigger></Trigger> <Target>_self</Target> <ClientTrigger>alert('caught an employee click');</ClientTrigger> </Behavior> </Behaviors>
<Data /> Options
Table 4. <Data /> Options Desired Return Value Value for <Data /> Element Text of selected node default^nodeText XML tag name of selected node default^nodeName XPath to the selected node default^nodeNamePath XML of the selected node default^nodeXML Text values for all the elements in the XPath down to the selected node default^nodeTextPath Text value of a child element of the selected node path^XPath/to/child Constant value const^ValueToReturn
<ItemList /> Options
Table 5. <ItemList /> Options Child Node Display Behavior Value for <ItemList /> Element Show all children Default behavior. You do not need to include an <ItemList /> element in the NodeStyle XML to display all the children for a node.
Do not show any children <ItemList listtype="include"></ItemList>Show most children <ItemList listtype="exclude"> <Item nodename=ChildOnetoHide" /> <Item nodename="ChildTwotoHide " /> </ItemList>Show a few children <ItemList listtype="include"> <Item nodename="ChildOnetoDisplay" /> <Item nodename="ChildTwotoDisplay" /> </ItemList>Parent topic: Tree builder
Library | Support |