Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.dojo.components
Class Tree

    java.lang.Object
      org.apache.struts2.components.Component
          org.apache.struts2.components.UIBean
              org.apache.struts2.components.ClosingUIBean
                  org.apache.struts2.dojo.components.Tree

    public class Tree

extends ClosingUIBean

Renders a tree widget with AJAX support.

The "id "attribute is normally specified(recommended), such that it could be looked up using javascript if necessary. The "id" attribute is required if the "selectedNotifyTopic" or the "href" attributes are going to be used.

<s:tree id="..." label="..."> <s:treenode id="..." label="..." /> <s:treenode id="..." label="..."> <s:treenode id="..." label="..." /> <s:treenode id="..." label="..." /> </s:treenode> <s:treenode id="..." label="..." /> </s:tree> <s:tree id="..." rootNode="..." nodeIdProperty="..." nodeTitleProperty="..." childCollectionProperty="..." /> <s:url id="nodesUrl" namespace="/nodecorate" action="getNodes" /> <div style="float:left; margin-right: 50px;"> <sx:tree id="tree" href="%{#nodesUrl}" /> </div> On this example the url specified on the "href" attibute will be called to load the elements on the root. The response is expected to be a JSON array of objects like: [ { label: "Node 1", hasChildren: false, id: "Node1" }, { label: "Node 2", hasChildren: true, id: "Node2" }, ] "label" is the text that will be displayed for the node. "hasChildren" marks the node has having children or not (if true, a plus icon will be assigned to the node so it can be expanded). The "id" attribute will be used to load the children of the node, when the node is expanded. When a node is expanded a request will be made to the url in the "href" attribute and the node's "id" will be passed in the parameter "nodeId". The children collection for a node will be loaded only once, to reload the children of a node, use the "reload()" function of the treenode widget. To reload the children nodes of "Node1" from the example above use the following javascript: dojo.widget.byId("Node1").reload();

Field Summary
`protected String` | `blankIconSrc`
`protected String` | `childCollectionProperty`
`protected String` | `collapsedNotifyTopics`
`protected String` | `errorNotifyTopics`
`protected String` | `expandedNotifyTopics`
`protected String` | `expandIconSrcMinus`
`protected String` | `expandIconSrcPlus`
`protected String` | `gridIconSrcC`
`protected String` | `gridIconSrcL`
`protected String` | `gridIconSrcP`
`protected String` | `gridIconSrcV`
`protected String` | `gridIconSrcX`
`protected String` | `gridIconSrcY`
`protected String` | `href`
`protected String` | `iconHeight`
`protected String` | `iconWidth`
`protected String` | `nodeIdProperty`
`protected String` | `nodeTitleProperty`
`protected String` | `rootNodeAttr`
`protected String` | `selectedNotifyTopics`
`protected String` | `showGrid`
`protected String` | `showRootGrid`
`protected String` | `templateCssPath`
`protected String` | `toggle`
`protected String` | `toggleDuration`

Fields inherited from class org.apache.struts2.components.UIBean
`accesskey, cssClass, cssErrorClass, cssErrorStyle, cssStyle, defaultTemplateDir, defaultUITheme, disabled, dynamicAttributes, errorPosition, id, javascriptTooltip, key, label, labelPosition, labelSeparator, name, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselect, request, requiredLabel, requiredPosition, response, tabindex, template, templateDir, templateEngineManager, templateSuffix, theme, title, tooltip, tooltipConfig, tooltipCssClass, tooltipDelay, tooltipIconPath, uiThemeExpansionToken, value`

Fields inherited from class org.apache.struts2.components.Component
`actionMapper, COMPONENT_STACK, devMode, parameters, stack, standardAttributesMap, throwExceptionOnELFailure`

Constructor Summary
`Tree(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`

Method Summary
`void` | `addChildrenId(String id)`
`protected void` | `evaluateExtraParams()`
`String` | `getBlankIconSrc()`
`String` | `getChildCollectionProperty()`
`String` | `getDefaultOpenTemplate()`
`protected String` | `getDefaultTemplate()`
`String` | `getExpandIconSrcMinus()`
`String` | `getExpandIconSrcPlus()`
`String` | `getGridIconSrcC()`
`String` | `getGridIconSrcL()`
`String` | `getGridIconSrcP()`
`String` | `getGridIconSrcV()`
`String` | `getGridIconSrcX()`
`String` | `getGridIconSrcY()`
`String` | `getIconHeight()`
`String` | `getIconWidth()`
`String` | `getNodeIdProperty()`
`String` | `getNodeTitleProperty()`
`String` | `getRootNode()`
`String` | `getShowGrid()`
`String` | `getShowRootGrid()`
`String` | `getTemplateCssPath()`
`String` | `getTheme()`
`String` | `getToggle()`
`String` | `getToggleDuration()`
`void` | `setBlankIconSrc(String blankIconSrc)`
`void` | `setChildCollectionProperty(String childCollectionProperty)`
`void` | `setCollapsedNotifyTopics(String collapsedNotifyTopics)`
`void` | `setCssClass(String cssClass)`
`void` | `setCssStyle(String cssStyle)`
`void` | `setErrorNotifyTopics(String errorNotifyTopics)`
`void` | `setExpandedNotifyTopics(String expandedNotifyTopics)`
`void` | `setExpandIconSrcMinus(String expandIconSrcMinus)`
`void` | `setExpandIconSrcPlus(String expandIconSrcPlus)`
`void` | `setGridIconSrcC(String gridIconSrcC)`
`void` | `setGridIconSrcL(String gridIconSrcL)`
`void` | `setGridIconSrcP(String gridIconSrcP)`
`void` | `setGridIconSrcV(String gridIconSrcV)`
`void` | `setGridIconSrcX(String gridIconSrcX)`
`void` | `setGridIconSrcY(String gridIconSrcY)`
`void` | `setHref(String href)`
`void` | `setIconHeight(String iconHeight)`
`void` | `setIconWidth(String iconWidth)`
`void` | `setId(String id)`
`void` | `setName(String name)`
`void` | `setNodeIdProperty(String nodeIdProperty)`
`void` | `setNodeTitleProperty(String nodeTitleProperty)`
`void` | `setRootNode(String rootNode)`
`void` | `setSelectedNotifyTopics(String selectedNotifyTopics)`
`void` | `setShowGrid(String showGrid)`
`void` | `setShowRootGrid(String showRootGrid)`
`void` | `setTemplateCssPath(String templateCssPath)`
`void` | `setTheme(String theme)`
`void` | `setToggle(String toggle)`
`void` | `setToggleDuration(String toggleDuration)`
`void` | `setTreeCollapsedTopics(String collapsedNotifyTopic)`
`void` | `setTreeExpandedTopics(String expandedNotifyTopic)`
`void` | `setTreeSelectedTopic(String selectedNotifyTopic)`
`boolean` | `start(Writer writer)`

Methods inherited from class org.apache.struts2.components.ClosingUIBean
`setOpenTemplate`

Methods inherited from class org.apache.struts2.components.UIBean
`addFormParameter, buildTemplateName, copyParams, enableAncestorFormCustomOnsubmit, end, ensureAttributeSafelyNotEscaped, escape, evaluateNameValue, evaluateParams, getId, getTemplate, getTemplateDir, getTooltipConfig, getValueClassType, mergeTemplate, populateComponentHtmlId, setAccesskey, setClass, setCssErrorClass, setCssErrorStyle, setDefaultTemplateDir, setDefaultUITheme, setDisabled, setDynamicAttributes, setErrorPosition, setJavascriptTooltip, setKey, setLabel, setLabelposition, setLabelSeparator, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setRequiredLabel, setRequiredPosition, setStyle, setTabindex, setTemplate, setTemplateDir, setTemplateEngineManager, setTitle, setTooltip, setTooltipConfig, setTooltipCssClass, setTooltipDelay, setTooltipIconPath, setUIThemeExpansionToken, setValue`

Methods inherited from class org.apache.struts2.components.Component
`addAllParameters, addParameter, altSyntax, completeExpressionIfAltSyntax, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, getStandardAttributes, isValidTagAttribute, popComponentStack, setActionMapper, setDevMode, setThrowExceptionsOnELFailure, setUrlHelper, stripExpressionIfAltSyntax, toString, usesBody`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### toggle

    protected String toggle

### selectedNotifyTopics

    protected String selectedNotifyTopics

### expandedNotifyTopics

    protected String expandedNotifyTopics

### collapsedNotifyTopics

    protected String collapsedNotifyTopics

### rootNodeAttr

    protected String rootNodeAttr

### childCollectionProperty

    protected String childCollectionProperty

### nodeTitleProperty

    protected String nodeTitleProperty

### nodeIdProperty

    protected String nodeIdProperty

### showRootGrid

    protected String showRootGrid

### showGrid

    protected String showGrid

### blankIconSrc

    protected String blankIconSrc

### gridIconSrcL

    protected String gridIconSrcL

### gridIconSrcV

    protected String gridIconSrcV

### gridIconSrcP

    protected String gridIconSrcP

### gridIconSrcC

    protected String gridIconSrcC

### gridIconSrcX

    protected String gridIconSrcX

### gridIconSrcY

    protected String gridIconSrcY

### expandIconSrcPlus

    protected String expandIconSrcPlus

### expandIconSrcMinus

    protected String expandIconSrcMinus

### iconWidth

    protected String iconWidth

### iconHeight

    protected String iconHeight

### toggleDuration

    protected String toggleDuration

### templateCssPath

    protected String templateCssPath

### href

    protected String href

### errorNotifyTopics

    protected String errorNotifyTopics

Constructor Detail

### Tree

    public Tree(com.opensymphony.xwork2.util.ValueStack stack,
                javax.servlet.http.HttpServletRequest request,
                javax.servlet.http.HttpServletResponse response)

Method Detail

### start

    public boolean start(Writer writer)

  Overrides:
    `start` in class `ClosingUIBean`

### evaluateExtraParams

    protected void evaluateExtraParams()

  Overrides:
    `evaluateExtraParams` in class `UIBean`

### addChildrenId

    public void addChildrenId(String id)

### setTheme

    public void setTheme(String theme)

  Overrides:
    `setTheme` in class `UIBean`

### getTheme

    public String getTheme()

  Overrides:
    `getTheme` in class `UIBean`

### getDefaultOpenTemplate

    public String getDefaultOpenTemplate()

  Specified by:
    `getDefaultOpenTemplate` in class `ClosingUIBean`

### getDefaultTemplate

    protected String getDefaultTemplate()

  Specified by:
    `getDefaultTemplate` in class `UIBean`

### getToggle

    public String getToggle()

### setToggle

    public void setToggle(String toggle)

### setTreeSelectedTopic

    public void setTreeSelectedTopic(String selectedNotifyTopic)

### setTreeExpandedTopics

    public void setTreeExpandedTopics(String expandedNotifyTopic)

### setTreeCollapsedTopics

    public void setTreeCollapsedTopics(String collapsedNotifyTopic)

### getRootNode

    public String getRootNode()

### setRootNode

    public void setRootNode(String rootNode)

### getChildCollectionProperty

    public String getChildCollectionProperty()

### setChildCollectionProperty

    public void setChildCollectionProperty(String childCollectionProperty)

### getNodeTitleProperty

    public String getNodeTitleProperty()

### setNodeTitleProperty

    public void setNodeTitleProperty(String nodeTitleProperty)

### getNodeIdProperty

    public String getNodeIdProperty()

### setNodeIdProperty

    public void setNodeIdProperty(String nodeIdProperty)

### setShowRootGrid

    public void setShowRootGrid(String showRootGrid)

### getShowRootGrid

    public String getShowRootGrid()

### getBlankIconSrc

    public String getBlankIconSrc()

### setBlankIconSrc

    public void setBlankIconSrc(String blankIconSrc)

### getExpandIconSrcMinus

    public String getExpandIconSrcMinus()

### setExpandIconSrcMinus

    public void setExpandIconSrcMinus(String expandIconSrcMinus)

### getExpandIconSrcPlus

    public String getExpandIconSrcPlus()

### setExpandIconSrcPlus

    public void setExpandIconSrcPlus(String expandIconSrcPlus)

### getGridIconSrcC

    public String getGridIconSrcC()

### setGridIconSrcC

    public void setGridIconSrcC(String gridIconSrcC)

### getGridIconSrcL

    public String getGridIconSrcL()

### setGridIconSrcL

    public void setGridIconSrcL(String gridIconSrcL)

### getGridIconSrcP

    public String getGridIconSrcP()

### setGridIconSrcP

    public void setGridIconSrcP(String gridIconSrcP)

### getGridIconSrcV

    public String getGridIconSrcV()

### setGridIconSrcV

    public void setGridIconSrcV(String gridIconSrcV)

### getGridIconSrcX

    public String getGridIconSrcX()

### setGridIconSrcX

    public void setGridIconSrcX(String gridIconSrcX)

### getGridIconSrcY

    public String getGridIconSrcY()

### setGridIconSrcY

    public void setGridIconSrcY(String gridIconSrcY)

### getIconHeight

    public String getIconHeight()

### setIconHeight

    public void setIconHeight(String iconHeight)

### getIconWidth

    public String getIconWidth()

### setIconWidth

    public void setIconWidth(String iconWidth)

### getTemplateCssPath

    public String getTemplateCssPath()

### setTemplateCssPath

    public void setTemplateCssPath(String templateCssPath)

### getToggleDuration

    public String getToggleDuration()

### setToggleDuration

    public void setToggleDuration(String toggleDuration)

### getShowGrid

    public String getShowGrid()

### setShowGrid

    public void setShowGrid(String showGrid)

### setCssClass

    public void setCssClass(String cssClass)

  Overrides:
    `setCssClass` in class `UIBean`

### setCssStyle

    public void setCssStyle(String cssStyle)

  Overrides:
    `setCssStyle` in class `UIBean`

### setId

    public void setId(String id)

  Overrides:
    `setId` in class `UIBean`

### setName

    public void setName(String name)

  Overrides:
    `setName` in class `UIBean`

### setCollapsedNotifyTopics

    public void setCollapsedNotifyTopics(String collapsedNotifyTopics)

### setExpandedNotifyTopics

    public void setExpandedNotifyTopics(String expandedNotifyTopics)

### setSelectedNotifyTopics

    public void setSelectedNotifyTopics(String selectedNotifyTopics)

### setHref

    public void setHref(String href)

### setErrorNotifyTopics

    public void setErrorNotifyTopics(String errorNotifyTopics)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000–2018 Apache Software Foundation. All rights reserved.