diff --git a/apps/showcase/src/main/java/org/apache/struts/action2/showcase/DynamicTreeSelectAction.java b/apps/showcase/src/main/java/org/apache/struts/action2/showcase/DynamicTreeSelectAction.java new file mode 100644 index 000000000..e1eb6b8d3 --- /dev/null +++ b/apps/showcase/src/main/java/org/apache/struts/action2/showcase/DynamicTreeSelectAction.java @@ -0,0 +1,30 @@ +package org.apache.struts.action2.showcase; + +import org.apache.struts.action2.showcase.ajax.tree.Category; + +import com.opensymphony.xwork.ActionSupport; + +public class DynamicTreeSelectAction extends ActionSupport { + + private long nodeId; + private Category currentCategory; + + + public void setNodeId(long nodeId) { + this.nodeId = nodeId; + } + public long getNodeId() { + return nodeId; + } + + + public String execute() throws Exception { + currentCategory = Category.getById(nodeId); + return SUCCESS; + } + + + public String getNodeName() { + return currentCategory.getName(); + } +} diff --git a/apps/showcase/src/main/java/org/apache/struts/action2/showcase/ShowDynamicTreeAction.java b/apps/showcase/src/main/java/org/apache/struts/action2/showcase/ShowDynamicTreeAction.java new file mode 100644 index 000000000..36594477c --- /dev/null +++ b/apps/showcase/src/main/java/org/apache/struts/action2/showcase/ShowDynamicTreeAction.java @@ -0,0 +1,14 @@ +package org.apache.struts.action2.showcase; + +import org.apache.struts.action2.showcase.ajax.tree.Category; + +import com.opensymphony.xwork.ActionSupport; + + +public class ShowDynamicTreeAction extends ActionSupport { + + public Category getTreeRootNode() { + return Category.getById(1); + } +} + diff --git a/apps/showcase/src/main/webapp/WEB-INF/classes/xwork-tags-ui.xml b/apps/showcase/src/main/webapp/WEB-INF/classes/xwork-tags-ui.xml index e3bfc1bec..dfd70fe16 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/classes/xwork-tags-ui.xml +++ b/apps/showcase/src/main/webapp/WEB-INF/classes/xwork-tags-ui.xml @@ -36,5 +36,18 @@ tooltipExample.jsp + + /tags/ui/treeExampleDynamic.jsp + + + + + + + /tags/ui/staticTreeSelect.jsp + + + /tags/ui/dynamicTreeSelect.jsp + diff --git a/apps/showcase/src/main/webapp/WEB-INF/decorators.xml b/apps/showcase/src/main/webapp/WEB-INF/decorators.xml index a1752f52b..250136939 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/decorators.xml +++ b/apps/showcase/src/main/webapp/WEB-INF/decorators.xml @@ -12,6 +12,7 @@ /ajax/AjaxResult* /AjaxTest.action /ajax/remoteforms/AjaxRemoteForm.action + /tags/ui/ajax/* diff --git a/apps/showcase/src/main/webapp/tags/ui/dynamicTreeSelect.jsp b/apps/showcase/src/main/webapp/tags/ui/dynamicTreeSelect.jsp new file mode 100644 index 000000000..449036c35 --- /dev/null +++ b/apps/showcase/src/main/webapp/tags/ui/dynamicTreeSelect.jsp @@ -0,0 +1,6 @@ +<%@taglib prefix="saf" uri="/struts-action" %> + +Id:
+Name:
+ + diff --git a/apps/showcase/src/main/webapp/tags/ui/index.jsp b/apps/showcase/src/main/webapp/tags/ui/index.jsp index aafc4bad6..96c9c57f7 100644 --- a/apps/showcase/src/main/webapp/tags/ui/index.jsp +++ b/apps/showcase/src/main/webapp/tags/ui/index.jsp @@ -12,6 +12,8 @@
  • UI Example (Velocity)
  • Option Transfer Select UI Example
  • Rich Text Editor UI Example
  • +
  • Tree Example (static) +
  • Tree Example (dynamic) <%--li>UI population using iterator tag diff --git a/apps/showcase/src/main/webapp/tags/ui/staticTreeSelect.jsp b/apps/showcase/src/main/webapp/tags/ui/staticTreeSelect.jsp new file mode 100644 index 000000000..65b4eb598 --- /dev/null +++ b/apps/showcase/src/main/webapp/tags/ui/staticTreeSelect.jsp @@ -0,0 +1,28 @@ +<%@taglib prefix="saf" uri="/struts-action" %> + +<% + request.setAttribute("decorator", "none"); + response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 + response.setHeader("Pragma","no-cache"); //HTTP 1.0 + response.setDateHeader ("Expires", 0); //prevents caching at the proxy server +%> + + +<%-- + +--%> + +<%=request.getParameter("nodeId") %> diff --git a/apps/showcase/src/main/webapp/tags/ui/treeExampleDynamic.jsp b/apps/showcase/src/main/webapp/tags/ui/treeExampleDynamic.jsp new file mode 100644 index 000000000..f3276382f --- /dev/null +++ b/apps/showcase/src/main/webapp/tags/ui/treeExampleDynamic.jsp @@ -0,0 +1,44 @@ +<%@taglib prefix="saf" uri="/struts-action" %> + + + +Showcase - UI Tag Example - Tree Example (Dynamic) + + + + + + + + +
    + + +
    + +
    +Please click on any of the tree nodes. +
    + + + + \ No newline at end of file diff --git a/apps/showcase/src/main/webapp/tags/ui/treeExampleStatic.jsp b/apps/showcase/src/main/webapp/tags/ui/treeExampleStatic.jsp new file mode 100644 index 000000000..78e294bc5 --- /dev/null +++ b/apps/showcase/src/main/webapp/tags/ui/treeExampleStatic.jsp @@ -0,0 +1,50 @@ +<%@taglib prefix="saf" uri="/struts-action" %> + + +Showcase - UI Tag Example - Tree Example (Static) + + + + + + + +
    + + + + + + + + + + + + + + +
    + + +
    +Please click on any node on the tree. +
    + + + + \ No newline at end of file