Author: nbelaevski
Date: 2010-10-31 12:27:50 -0400 (Sun, 31 Oct 2010)
New Revision: 19799
Modified:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java
trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
Log:
https://jira.jboss.org/browse/RF-9315
Modified: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java
===================================================================
---
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java 2010-10-31
16:26:17 UTC (rev 19798)
+++
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java 2010-10-31
16:27:50 UTC (rev 19799)
@@ -29,6 +29,7 @@
import javax.faces.bean.SessionScoped;
import javax.swing.tree.TreeNode;
+import org.richfaces.component.SwitchType;
import org.richfaces.log.LogFactory;
import org.richfaces.log.Logger;
@@ -46,6 +47,8 @@
private List<TreeNode> rootNodes;
+ private SwitchType toggleMode = SwitchType.DEFAULT;
+
@PostConstruct
public void init() {
try {
@@ -60,5 +63,16 @@
public List<TreeNode> getRootNodes() {
return rootNodes;
}
+
+ public SwitchType[] getModes() {
+ return SwitchType.values();
+ }
+ public SwitchType getToggleMode() {
+ return toggleMode;
+ }
+
+ public void setToggleMode(SwitchType switchType) {
+ this.toggleMode = switchType;
+ }
}
Modified: trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-10-31 16:26:17 UTC (rev
19798)
+++ trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-10-31 16:27:50 UTC (rev
19799)
@@ -11,17 +11,23 @@
</h:head>
<h:body>
- <it:tree id="tree" var="node"
value="#{treeBean.rootNodes}">
- <it:treeNode>
- <h:panelGroup id="group">
- #{node.data}
- </h:panelGroup>
- </it:treeNode>
- </it:tree>
-
<h:form>
+ <h:selectOneRadio value="#{treeBean.toggleMode}"
onclick="submit()">
+ <f:selectItems value="#{treeBean.modes}" var="item"
itemValue="#{item}" />
+ </h:selectOneRadio>
+ </h:form>
+
+ <h:form id="form">
+ <it:tree id="tree" var="node"
value="#{treeBean.rootNodes}" toggleMode="#{treeBean.toggleMode}">
+ <it:treeNode>
+ <h:panelGroup id="group">
+ #{node.data}
+ </h:panelGroup>
+ </it:treeNode>
+ </it:tree>
+
<h:commandLink value="Re-render">
- <f:ajax render=":tree" />
+ <f:ajax render=":form:tree" execute="@all" />
</h:commandLink>
</h:form>
</h:body>