diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Tree.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Tree.java index 5e03a4c25..6265e37b3 100644 --- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Tree.java +++ b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Tree.java @@ -47,8 +47,6 @@ import com.opensymphony.xwork2.util.ValueStack; * * * - *
- ** * * - *Tree loaded statically
* <s:tree id="..." label="..."> * <s:treenode id="..." label="..." /> * <s:treenode id="..." label="..."> @@ -57,34 +55,25 @@ import com.opensymphony.xwork2.util.ValueStack; * &;lt;/s:treenode> * <s:treenode id="..." label="..." /> * </s:tree> - *
Tree loaded dynamically
- ** <s:tree * id="..." * rootNode="..." * nodeIdProperty="..." * nodeTitleProperty="..." * childCollectionProperty="..." /> - ** * * - *
Tree loaded dynamically using AJAX
- *
* <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 + * 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",
@@ -97,21 +86,18 @@ import com.opensymphony.xwork2.util.ValueStack;
* id: "Node2"
* },
* ]
- *
*
- * "label" is the text that will be displayed for the node. "hasChildren" marks the node has + * "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".
+ * 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 + * 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();
- *
*
*/
@StrutsTag(name="tree", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TreeTag", description="Render a tree widget.")