netui:tree Tag

<netui:tree> Tag

Renders a navigable tree of <netui:node> tags.

Syntax

<netui:tree
    action="string_action"
    [dataSource="expression_datasource"]
    [imageHandleDownLast="string_imageHandleDownLast"]
    [imageHandleDownMiddle="string_imageHandleDownMiddle"]
    [imageHandleRightLast="string_imageHandleRightLast"]
    [imageHandleRightMiddle="string_imageHandleRightMiddle"]
    [imageLineLast="string_imageLineLast"]
    [imageLineMiddle="string_imageLineMiddle"]
    [imageLineVertical="string_imageLIneVertical"]
    [imageRoot="string_imageRoot"]
    [rootNode="string_rootNode"]
    [style="string_style"]
    [styleSelected="string_styleSelected"]
    [styleUnselected="string_styleUnselected"]
    tree="string_or_expression_sessionAttribute" />

Description

Renders a navigable tree of <netui:node> tags.

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 image names should be:

Attributes

actionThe action method which handles expansion/contraction of tree nodes.
 
RequiredSupports runtime expression evaluationData bindable
YesNoYes

dataSource

The dataSource attribute determines both (1) the source of populating data for the tag and (2) the object to which the tag submits data.

For example, assume that the Controller file (= JPF file) contains a Form Bean with the property foo. Then the following <netui:textBox> tag will (1) draw populating data from the Form Bean's foo property and (2) submit user defined data to the same property.

    <netui:textBox dataSource="{actionForm.foo}" />

The dataSource attribute takes either a data binding expression or the name of a Form Bean property. In the above example, <netui:textBox dataSource="foo" /> would have the exactly same behavior.

When the tag is used to submit data, the data binding expression must refer to a Form Bean property. In cases where the tag is not used to submit data, but is used for displaying data only, the data binding expression need not refer to a Form Bean property. For example, assume that myIterativeData is a member variable on the Controller file ( = JPF file). The following <netui-data:repeater> tag draws its data from myIterativeData.

    <netui-data:repeater dataSource="{pageFlow.myIterativeData}">

 
RequiredSupports runtime expression evaluationData bindable
NoNoRead / Write

imageHandleDownLastThe image name for an open non-leaf node with no line below it. (Defaults to "handledownlast.gif".)
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

imageHandleDownMiddleThe image name for an open non-leaf node with a line below it. (Defaults to "handledownmiddle.gif".)
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

imageHandleRightLastThe image name for a closed non-leaf node with no line below it. (Defaults to "handlerightlast.gif".)
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

imageHandleRightMiddleThe image name for a closed non-leaf node with a line below it. (Defaults to "handlerightmiddle.gif".)
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

imageLineLastThe image name for a blank area of the tree. (Defaults to "linelastnode.gif")
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

imageLineMiddleThe image name for an area with a line through it. (Defaults to "linemiddlenode.gif").
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

imageLineVerticalThe image name for an area with a line through it. (Defaults to "linevertical.gif").
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

imageRootThe directory containing the images for tree icons, relative to the page that includes the <netui:tree> tag.
 
RequiredSupports runtime expression evaluationData bindable
NoYesNo

rootNode Sets the root TreeNode of this tree.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

styleThe CSS style to be applied to the entire tree.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

styleSelectedThe CSS style to be applied to the text of selected nodes.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

styleUnselectedThe CSS style to be applied to unselected nodes.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

tree The name of session attribute under which the root TreeNode is stored. This attribute may take a literal or a data binding expression.
 
RequiredSupports runtime expression evaluationData bindable
YesNoRead / Write

Sample

The following example shows a <netui:tree> tag with a set of children <netui:node> tags that form the tree's navigational structure. The tree attribute stores the tree in the Session object, under the property "tree". The imageRoot attribute points to fa older of images relative to the Page Flow directory.
  <netui:tree 
    tree="{session.tree}" 
    imageRoot="treeImages" 
    style="tree-control" 
    action="treeState">
      <netui:node label="Root Folder" expanded="true" action="treeState" target="contentFrame">
          <netui:node label="I" expanded="false" action="treeState" target="contentFrame">
              <netui:node label="A" expanded="false" action="treeState" target="contentFrame">
                  <netui:node label="1" action="treeState" target="contentFrame"/>
                  <netui:node label="2" action="treeState" target="contentFrame"/>
              </netui:node>
          </netui:node>            
      </netui:node>
  </netui:tree>

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui/tree/tree.jsp

Related Topics

<netui:tree> Tag Sample

<netui:node> Tag

TreeNode Class