FileDocCategorySizeDatePackage
TreeNode.javaAPI DocExample3603Mon Jul 23 13:26:36 BST 2007org.apache.struts2.components

TreeNode

public class TreeNode extends ClosingUIBean
Renders a tree node within a tree widget with AJAX support.

Either of the following combinations should be used depending on if the tree is to be constrcted dynamically or statically.

Dynamically

  • id - id of this tree node
  • title - label to be displayed for this tree node
Statically
  • rootNode - the parent node of which this tree is derived from
  • nodeIdProperty - property to obtained this current tree node's id
  • nodeTitleProperty - property to obtained this current tree node's title
  • childCollectionProperty - property that returnds this current tree node's children

Examples



<-- statically -->
<s:tree id="..." label="...">
<s:treenode id="..." label="..." />
<s:treenode id="..." label="...">
<s:treenode id="..." label="..." />
<s:treenode id="..." label="..." />
&;lt;/s:treenode>
<s:treenode id="..." label="..." />
</s:tree>

<-- dynamically -->
<s:tree
id="..."
rootNode="..."
nodeIdProperty="..."
nodeTitleProperty="..."
childCollectionProperty="..." />


Fields Summary
private static final String
TEMPLATE
private static final String
OPEN_TEMPLATE
Constructors Summary
public TreeNode(com.opensymphony.xwork2.util.ValueStack stack, HttpServletRequest request, HttpServletResponse response)


           
        super(stack, request, response);
    
Methods Summary
public java.lang.StringgetDefaultOpenTemplate()

        return OPEN_TEMPLATE;
    
protected java.lang.StringgetDefaultTemplate()

        return TEMPLATE;
    
public voidsetLabel(java.lang.String label)

        super.setLabel(label);