Save This Page
Home » struts-2.1.8.1-src » org.apache.struts2.dojo » components » [javadoc | source]
org.apache.struts2.dojo.components
public class: Tree [javadoc | source]
java.lang.Object
   org.apache.struts2.components.Component
      org.apache.struts2.components.UIBean
         org.apache.struts2.components.ClosingUIBean
            org.apache.struts2.dojo.components.Tree
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 toggle     
protected  String selectedNotifyTopics     
protected  String expandedNotifyTopics     
protected  String collapsedNotifyTopics     
protected  String rootNodeAttr     
protected  String childCollectionProperty     
protected  String nodeTitleProperty     
protected  String nodeIdProperty     
protected  String showRootGrid     
protected  String showGrid     
protected  String blankIconSrc     
protected  String gridIconSrcL     
protected  String gridIconSrcV     
protected  String gridIconSrcP     
protected  String gridIconSrcC     
protected  String gridIconSrcX     
protected  String gridIconSrcY     
protected  String expandIconSrcPlus     
protected  String expandIconSrcMinus     
protected  String iconWidth     
protected  String iconHeight     
protected  String toggleDuration     
protected  String templateCssPath     
protected  String href     
protected  String errorNotifyTopics     
Fields inherited from org.apache.struts2.components.ClosingUIBean:
openTemplate
Fields inherited from org.apache.struts2.components.UIBean:
request,  response,  templateSuffix,  template,  templateDir,  theme,  key,  id,  cssClass,  cssStyle,  cssErrorClass,  cssErrorStyle,  disabled,  label,  labelPosition,  labelSeparator,  requiredposition,  name,  required,  tabindex,  value,  title,  onclick,  ondblclick,  onmousedown,  onmouseup,  onmouseover,  onmousemove,  onmouseout,  onfocus,  onblur,  onkeypress,  onkeydown,  onkeyup,  onselect,  onchange,  accesskey,  tooltip,  tooltipConfig,  javascriptTooltip,  tooltipDelay,  tooltipCssClass,  tooltipIconPath,  dynamicAttributes,  defaultTemplateDir,  defaultUITheme,  templateEngineManager
Fields inherited from org.apache.struts2.components.Component:
COMPONENT_STACK,  stack,  parameters,  actionMapper,  throwExceptionOnELFailure
Constructor:
 public Tree(ValueStack stack,
    HttpServletRequest request,
    HttpServletResponse response) 
Method from org.apache.struts2.dojo.components.Tree Summary:
addChildrenId,   evaluateExtraParams,   getBlankIconSrc,   getChildCollectionProperty,   getDefaultOpenTemplate,   getDefaultTemplate,   getExpandIconSrcMinus,   getExpandIconSrcPlus,   getGridIconSrcC,   getGridIconSrcL,   getGridIconSrcP,   getGridIconSrcV,   getGridIconSrcX,   getGridIconSrcY,   getIconHeight,   getIconWidth,   getNodeIdProperty,   getNodeTitleProperty,   getRootNode,   getShowGrid,   getShowRootGrid,   getTemplateCssPath,   getTheme,   getToggle,   getToggleDuration,   setBlankIconSrc,   setChildCollectionProperty,   setCollapsedNotifyTopics,   setCssClass,   setCssStyle,   setErrorNotifyTopics,   setExpandIconSrcMinus,   setExpandIconSrcPlus,   setExpandedNotifyTopics,   setGridIconSrcC,   setGridIconSrcL,   setGridIconSrcP,   setGridIconSrcV,   setGridIconSrcX,   setGridIconSrcY,   setHref,   setIconHeight,   setIconWidth,   setId,   setName,   setNodeIdProperty,   setNodeTitleProperty,   setRootNode,   setSelectedNotifyTopics,   setShowGrid,   setShowRootGrid,   setTemplateCssPath,   setTheme,   setToggle,   setToggleDuration,   setTreeCollapsedTopics,   setTreeExpandedTopics,   setTreeSelectedTopic,   start
Methods from org.apache.struts2.components.ClosingUIBean:
getDefaultOpenTemplate,   setOpenTemplate,   start
Methods from org.apache.struts2.components.UIBean:
addFormParameter,   buildTemplateName,   enableAncestorFormCustomOnsubmit,   end,   ensureAttributeSafelyNotEscaped,   escape,   evaluateExtraParams,   evaluateNameValue,   evaluateParams,   getDefaultTemplate,   getId,   getTemplate,   getTemplateDir,   getTheme,   getTooltipConfig,   getValueClassType,   mergeTemplate,   populateComponentHtmlId,   setAccesskey,   setCssClass,   setCssErrorClass,   setCssErrorStyle,   setCssStyle,   setDefaultTemplateDir,   setDefaultUITheme,   setDisabled,   setDynamicAttributes,   setId,   setJavascriptTooltip,   setKey,   setLabel,   setLabelSeparator,   setLabelposition,   setName,   setOnblur,   setOnchange,   setOnclick,   setOndblclick,   setOnfocus,   setOnkeydown,   setOnkeypress,   setOnkeyup,   setOnmousedown,   setOnmousemove,   setOnmouseout,   setOnmouseover,   setOnmouseup,   setOnselect,   setRequired,   setRequiredposition,   setTabindex,   setTemplate,   setTemplateDir,   setTemplateEngineManager,   setTheme,   setTitle,   setTooltip,   setTooltipConfig,   setTooltipCssClass,   setTooltipDelay,   setTooltipIconPath,   setValue
Methods from org.apache.struts2.components.Component:
addAllParameters,   addParameter,   altSyntax,   altSyntax,   completeExpressionIfAltSyntax,   copyParams,   determineActionURL,   determineNamespace,   end,   end,   fieldError,   findAncestor,   findString,   findString,   findStringIfAltSyntax,   findValue,   findValue,   findValue,   getComponentStack,   getParameters,   getStack,   popComponentStack,   setActionMapper,   setThrowExceptionsOnELFailure,   start,   stripExpressionIfAltSyntax,   stripExpressionIfAltSyntax,   toString,   usesBody
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.dojo.components.Tree Detail:
 public  void addChildrenId(String id) 
 protected  void evaluateExtraParams() 
 public String getBlankIconSrc() 
 public String getChildCollectionProperty() 
 public String getDefaultOpenTemplate() 
 protected String getDefaultTemplate() 
 public String getExpandIconSrcMinus() 
 public String getExpandIconSrcPlus() 
 public String getGridIconSrcC() 
 public String getGridIconSrcL() 
 public String getGridIconSrcP() 
 public String getGridIconSrcV() 
 public String getGridIconSrcX() 
 public String getGridIconSrcY() 
 public String getIconHeight() 
 public String getIconWidth() 
 public String getNodeIdProperty() 
 public String getNodeTitleProperty() 
 public String getRootNode() 
 public String getShowGrid() 
 public String getShowRootGrid() 
 public String getTemplateCssPath() 
 public String getTheme() 
 public String getToggle() 
 public String getToggleDuration() 
 public  void setBlankIconSrc(String blankIconSrc) 
 public  void setChildCollectionProperty(String childCollectionProperty) 
 public  void setCollapsedNotifyTopics(String collapsedNotifyTopics) 
 public  void setCssClass(String cssClass) 
 public  void setCssStyle(String cssStyle) 
 public  void setErrorNotifyTopics(String errorNotifyTopics) 
 public  void setExpandIconSrcMinus(String expandIconSrcMinus) 
 public  void setExpandIconSrcPlus(String expandIconSrcPlus) 
 public  void setExpandedNotifyTopics(String expandedNotifyTopics) 
 public  void setGridIconSrcC(String gridIconSrcC) 
 public  void setGridIconSrcL(String gridIconSrcL) 
 public  void setGridIconSrcP(String gridIconSrcP) 
 public  void setGridIconSrcV(String gridIconSrcV) 
 public  void setGridIconSrcX(String gridIconSrcX) 
 public  void setGridIconSrcY(String gridIconSrcY) 
 public  void setHref(String href) 
 public  void setIconHeight(String iconHeight) 
 public  void setIconWidth(String iconWidth) 
 public  void setId(String id) 
 public  void setName(String name) 
 public  void setNodeIdProperty(String nodeIdProperty) 
 public  void setNodeTitleProperty(String nodeTitleProperty) 
 public  void setRootNode(String rootNode) 
 public  void setSelectedNotifyTopics(String selectedNotifyTopics) 
 public  void setShowGrid(String showGrid) 
 public  void setShowRootGrid(String showRootGrid) 
 public  void setTemplateCssPath(String templateCssPath) 
 public  void setTheme(String theme) 
 public  void setToggle(String toggle) 
 public  void setToggleDuration(String toggleDuration) 
 public  void setTreeCollapsedTopics(String collapsedNotifyTopic) 
 public  void setTreeExpandedTopics(String expandedNotifyTopic) 
 public  void setTreeSelectedTopic(String selectedNotifyTopic) 
 public boolean start(Writer writer)