NetUI Tag Library Documentation (Version 1.0.2)

netui
netui:tree Tag

Renders a navigable tree of org.apache.beehive.netui.tags.tree.TreeElement objects.

Syntax

<netui:tree
    dataSource="string_dataSource"
    [disabledStyle="string_disableStyle"]
    [disabledStyleClass="string_disableStyleClass"]
    [escapeForHtml="boolean_htmlEscape"]
    [expansionAction="string_action"]
    [iconRoot="string_iconRoot"]
    [imageRoot="string_imageRoot"]
    [itemIcon="string_itemIcon"]
    [lastLineJoinImage="string_imageLineLast"]
    [lastNodeCollapsedImage="string_imageHandleRightLast"]
    [lastNodeExpandedImage="string_imageHandleDownLast"]
    [lineJoinImage="string_imageLineMiddle"]
    [nodeCollapsedImage="string_imageHandleRightMiddle"]
    [nodeExpandedImage="string_imageHandleDownMiddle"]
    [renderTagIdLookup="boolean_renderTagIdLookup"]
    [rootNodeCollapsedImage="string_rootNodeCollapsedImage"]
    [rootNodeExpandedImage="string_rootNodeExpandedImage"]
    [runAtClient="boolean_runAtClient"]
    [selectedStyle="string_selectedStyle"]
    [selectedStyleClass="string_selectedStyleClass"]
    selectionAction="string_action"
    selectionTarget="string_target"
    [spacerImage="string_spacerImage"]
    tagId="string_tagId"
    [treeStyle="string_treeStyle"]
    [treeStyleClass="string_treeStyleClass"]
    [unselectedStyle="string_unselectedStyle"]
    [unselectedStyleClass="string_unselectedStyleClasss"]
    [verticalLineImage="string_imageLIneVertical"] >
    ... JSP content ...
</netui:tree>

Description

Renders a navigable tree of org.apache.beehive.netui.tags.tree.TreeElement objects.

The tree is bound to a variable through the dataSource attribute. If the bound variable has been initialized, then the body content of this tag is not processed and the dataSource's version of the tree is rendered. If the bound variable has not been initialized, we will process the body, create the TreeElement tree structure, and set the bound variable with the newly created tree. A <netui:tree> tag cannot be nested within another <netui:tree> element.

This tag can automatically handle display icons for the tree nodes through the imageRoot attribute. If you point the imageRoot attribute at a folder containing appropriately named image files, the correct images will be used for any given state of the tree's nodes. The default image names are:

Attributes
dataSource
Required: Yes  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: No

sets an expression which indentifies the TreeElement that represents the root of the tree.
disabledStyle
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Set the style of a tree element when is is disabled. A disabled element will have a style that can be expanded/contracted, but may not be selected.
disabledStyleClass
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Set the style class of a tree element when is is disabled. A disabled element will have a style that may be expanded/contracted, but may not be selected.
escapeForHtml
Required: No  |   Type: boolean  |   Supports runtime evaluation / JSP Expression Language: No

When true the content of labels will be escaped for HTML.
expansionAction
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the action used for expanding and contracting tree nodes.
iconRoot
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The directory containing the icon images for tree items.
imageRoot
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The directory containing the images for tree icons.
itemIcon
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the default icon for TreeElements for a blank area of the tree. (Defaults to "folder.gif").
lastLineJoinImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image name for a blank area of the tree. (Defaults to "lastLineJoin.gif")
lastNodeCollapsedImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image name for a closed non-leaf node with no line below it. (Defaults to "lastNodeCollapsed.gif".)
lastNodeExpandedImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image name for an open non-leaf node with no line below it. (Defaults to "lastNodeExpanded.gif".)
lineJoinImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image name for an area with a line through it. (Defaults to "lineJoin.gif").
nodeCollapsedImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image name for a closed non-leaf node with a line below it. (Defaults to "nodeCollapsed.gif".)
nodeExpandedImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image name for an open non-leaf node with a line below it. (Defaults to "nodeExpanded.gif".)
renderTagIdLookup
Required: No  |   Type: boolean  |   Supports runtime evaluation / JSP Expression Language: No

Output the standard tagId to Id JavaScript.
rootNodeCollapsedImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image representing the root when it is collapsed. (Defaults to "rootCollapsed.gif").
rootNodeExpandedImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image representing the root when it is expanded. (Defaults to "rootExpanded.gif").
runAtClient
Required: No  |   Type: boolean  |   Supports runtime evaluation / JSP Expression Language: No

Indicates whether that base expand and contraction will happen on the client.
selectedStyle
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Set the style of a tree element when is is selected. This results in a style attribute being generated for this tree node.
selectedStyleClass
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Set the style class of a tree element when is is selected. This results in a class attribute being generated for this tree node.
selectionAction
Required: Yes  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the action used when a tree node is selected.
selectionTarget
Required:   |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the frame target used for selecting tree nodes.
spacerImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the image name for a spacer image used to align the other images inside the tree. (Defaults to "spacer.gif").
tagId
Required: Yes  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Set the id of the tree. This appears on the containing <div>.
treeStyle
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the style attribute of the tree.
treeStyleClass
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the class attribute of the tree.
unselectedStyle
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Set the style of a tree element when is is not selected. This results in a style attribute being generated for this tree node.
unselectedStyleClass
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Set the style class of a tree element when is is not selected. This results in a style attribute being generated for this tree node.
verticalLineImage
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The image name for an area with a line through it. (Defaults to "verticalLine.gif").

Example

The following example shows a <netui:tree> tag with a set of children <netui:treeLabel> and <netui:treeItem> tags that form the tree's navigational structure. The dataSource attribute identifies the org.apache.beehive.netui.tags.tree.TreeElement in the appropriate binding context; in this case, the page flow context is used. The selectionAction attribute is required so there can be a postback to the tree. tagId is used to uniquely identify a tree on the page.

  <netui:tree
    dataSource="pageFlow.myTree"
    selectionAction="postback"
    tagId="myTree">
      <netui:treeItem expanded="true" >
          <netui:treeLabel>Root Folder</netui:treeLabel>
          <netui:treeItem expanded="false">
              <netui:treeLabel>I</netui:treeLabel>
              <netui:treeItem expanded="false">
                  <netui:treeLabel>A</netui:treeLabel>
                  <netui:treeItem>1</netui:treeItem>
                  <netui:treeItem>2</netui:treeItem>
              </netui:treeItem>
          </netui:treeItem>
      </netui:treeItem>
  </netui:tree>


Tag Information
Tag Classorg.apache.beehive.netui.tags.tree.Tree
TagExtraInfo ClassNone
Body Contentscriptless
Display NameNone