Author: konstantin.mishin
Date: 2008-08-01 12:35:32 -0400 (Fri, 01 Aug 2008)
New Revision: 9869
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
Log:
RF-3653
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-08-01
16:35:20 UTC (rev 9868)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-08-01
16:35:32 UTC (rev 9869)
@@ -65,6 +65,13 @@
boolean showLines = tree.isShowConnectingLines();
String id = treeNode.getClientId(context);
+ String script;
+ if (tree.isExpanded()) {
+ script = (String)tree.getAttributes().get("oncollapse");
+ } else {
+ script = (String)tree.getAttributes().get("onexpand");
+ }
+
if (UITree.SWITCH_AJAX.equals(tree.getSwitchType())) {
UITreeNode nodeFacet = tree.getNodeFacet();
JSFunction function = AjaxRendererUtils.buildAjaxFunction(nodeFacet,
@@ -81,6 +88,8 @@
function.addParameter(eventOptions);
StringBuffer buffer = new StringBuffer();
+ buffer.append(script);
+ buffer.append(";");
function.appendScript(buffer);
buffer.append(";");
return buffer.toString();
@@ -89,6 +98,8 @@
String paramName = id + NODE_EXPANDED_INPUT_SUFFIX;
StringBuffer result = new StringBuffer();
+ result.append(script);
+ result.append(";");
result.append('{');
result.append("var form = A4J.findForm(this);");
result.append("var params = new Object();");
Show replies by date