[richfaces-svn-commits] JBoss Rich Faces SVN: r11898 - in trunk/samples/tree-demo/src/main: java/org/richfaces/rf4196 and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Dec 18 15:22:43 EST 2008


Author: nbelaevski
Date: 2008-12-18 15:22:43 -0500 (Thu, 18 Dec 2008)
New Revision: 11898

Modified:
   trunk/samples/tree-demo/src/main/java/org/richfaces/Bean.java
   trunk/samples/tree-demo/src/main/java/org/richfaces/rf4196/Bean.java
   trunk/samples/tree-demo/src/main/webapp/pages/rf-4196.jsp
Log:
https://jira.jboss.org/jira/browse/RF-5382

Modified: trunk/samples/tree-demo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/tree-demo/src/main/java/org/richfaces/Bean.java	2008-12-18 20:22:31 UTC (rev 11897)
+++ trunk/samples/tree-demo/src/main/java/org/richfaces/Bean.java	2008-12-18 20:22:43 UTC (rev 11898)
@@ -96,6 +96,9 @@
 
 	private int requestCounter = 0;
 	
+	private String ajaxNodeSelectionEncodeBehavior;
+	private String ajaxChildActivationEncodeBehavior;
+
 	public String getIcon() {
 		return icon;
 	}
@@ -503,4 +506,22 @@
 		
 		return requestCounter;
 	}
-}
\ No newline at end of file
+
+	public String getAjaxChildActivationEncodeBehavior() {
+		return ajaxChildActivationEncodeBehavior;
+	}
+	
+	public String getAjaxNodeSelectionEncodeBehavior() {
+		return ajaxNodeSelectionEncodeBehavior;
+	}
+	
+	public void setAjaxChildActivationEncodeBehavior(
+			String ajaxChildActivationEncodeBehavior) {
+		this.ajaxChildActivationEncodeBehavior = ajaxChildActivationEncodeBehavior;
+	}
+	
+	public void setAjaxNodeSelectionEncodeBehavior(
+			String ajaxNodeSelectionEncodeBehavior) {
+		this.ajaxNodeSelectionEncodeBehavior = ajaxNodeSelectionEncodeBehavior;
+	}
+}

Modified: trunk/samples/tree-demo/src/main/java/org/richfaces/rf4196/Bean.java
===================================================================
--- trunk/samples/tree-demo/src/main/java/org/richfaces/rf4196/Bean.java	2008-12-18 20:22:31 UTC (rev 11897)
+++ trunk/samples/tree-demo/src/main/java/org/richfaces/rf4196/Bean.java	2008-12-18 20:22:43 UTC (rev 11898)
@@ -1,7 +1,6 @@
 package org.richfaces.rf4196;
 
 import org.richfaces.component.UITree;
-import org.richfaces.event.NodeSelectedEvent;
 
 public class Bean {
 	private UITree tree;
@@ -26,7 +25,4 @@
 		tree.addRequestKey(null);
 	}
 	
-	public void select(NodeSelectedEvent event) {
-		tree.addNodeRequestKey(tree.getRowKey());
-	}
 }

Modified: trunk/samples/tree-demo/src/main/webapp/pages/rf-4196.jsp
===================================================================
--- trunk/samples/tree-demo/src/main/webapp/pages/rf-4196.jsp	2008-12-18 20:22:31 UTC (rev 11897)
+++ trunk/samples/tree-demo/src/main/webapp/pages/rf-4196.jsp	2008-12-18 20:22:43 UTC (rev 11898)
@@ -11,9 +11,31 @@
 			<a4j:status startText="...start..." stopText="stopped" />
 			
 			<h:form>
-				<rich:tree ajaxSubmitSelection="true" nodeSelectListener="#{rf4196.select}" ajaxKeys="#{null}" binding="#{rf4196.tree}" value="#{bean.data}" var="item" switchType="ajax">
+				ajaxChildActivationEncodeBehavior: 
+				<h:selectOneMenu value="#{bean.ajaxChildActivationEncodeBehavior}">
+					<f:selectItem itemLabel="default" itemValue=""/>
+					<f:selectItem itemLabel="none" itemValue="none"/>
+					<f:selectItem itemLabel="node" itemValue="node"/>
+					<f:selectItem itemLabel="subtree" itemValue="subtree"/>
+				</h:selectOneMenu><br />
+				
+				ajaxNodeSelectionEncodeBehavior:
+				<h:selectOneMenu value="#{bean.ajaxNodeSelectionEncodeBehavior}">
+					<f:selectItem itemLabel="default" itemValue=""/>
+					<f:selectItem itemLabel="none" itemValue="none"/>
+					<f:selectItem itemLabel="node" itemValue="node"/>
+					<f:selectItem itemLabel="subtree" itemValue="subtree"/>
+				</h:selectOneMenu><br />
+				<h:commandButton value="Apply" />
+			</h:form>
+			
+			<h:form>
+				<rich:tree ajaxNodeSelectionEncodeBehavior="#{bean.ajaxNodeSelectionEncodeBehavior}"
+				ajaxChildActivationEncodeBehavior="#{bean.ajaxChildActivationEncodeBehavior}"
+				ajaxSubmitSelection="true" binding="#{rf4196.tree}" value="#{bean.data}" var="item" switchType="ajax">
 					<rich:treeNode>
 						<h:outputText escape="false" value="#{item} <b style='color: red;'>#{bean.requestCounter}</b> Re-render: " />
+						<a4j:commandLink value="Default" /> /
 						<a4j:commandLink value="Node" action="#{rf4196.rerenderNode}" /> / 				
 						<a4j:commandLink value="Subtree" action="#{rf4196.rerenderSubtree}" />				
 					</rich:treeNode>




More information about the richfaces-svn-commits mailing list