Author: Alex.Kolonitsky
Date: 2009-09-14 10:03:34 -0400 (Mon, 14 Sep 2009)
New Revision: 15553
Modified:
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
branches/community/3.3.X/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
branches/community/3.3.X/ui/tree/src/main/templates/htmlTreeNode.jspx
Log:
oncomplete for treeNode does not work with ajax selection
https://jira.jboss.org/jira/browse/RF-3005
Modified:
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
---
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2009-09-14
13:05:18 UTC (rev 15552)
+++
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2009-09-14
14:03:34 UTC (rev 15553)
@@ -571,6 +571,9 @@
.append(" && event.ajaxSingle) {\n");
builder.append("params.").append(AjaxRendererUtils.AJAX_SINGLE_PARAMETER_NAME).append("
= event.ajaxSingle;\n");
builder.append("}\n");
+ if (!eventOptions.containsKey("oncomplete")) {
+ eventOptions.put("oncomplete", new
JSReference("event.oncomplete"));
+ }
JSFunction function = AjaxRendererUtils.buildAjaxFunction(tree, context);
function.addParameter(eventOptions);
Modified:
branches/community/3.3.X/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
---
branches/community/3.3.X/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2009-09-14
13:05:18 UTC (rev 15552)
+++
branches/community/3.3.X/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2009-09-14
14:03:34 UTC (rev 15553)
@@ -140,6 +140,10 @@
if (ajaxSingle && ajaxSingle == "true") {
event.ajaxSingle = this.id
}
+ var oncomplete = Richfaces.getNSAttribute("oncomplete", $(treeItem.id +
":text"));;
+ if (oncomplete && oncomplete != "") {
+ event.oncomplete = new Function("request", "event",
"data", oncomplete);
+ }
this.onAjaxSelect(event);
}
} else if (event[Richfaces.TreeExpandEvent]){
Modified: branches/community/3.3.X/ui/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- branches/community/3.3.X/ui/tree/src/main/templates/htmlTreeNode.jspx 2009-09-14
13:05:18 UTC (rev 15552)
+++ branches/community/3.3.X/ui/tree/src/main/templates/htmlTreeNode.jspx 2009-09-14
14:03:34 UTC (rev 15553)
@@ -227,9 +227,12 @@
]]>
</jsp:scriptlet>
</td>
- <td class="rich-tree-node-text
#{component.attributes['nodeClass']}"
- rich:selectedclass="#{selectedClass}"
rich:highlightedclass="#{highlightedClass}"
- id="#{clientId}:text"
rich:ajaxsingle="#{component.attributes['ajaxSingle']}">
+ <td id="#{clientId}:text"
+ class="rich-tree-node-text
#{component.attributes['nodeClass']}"
+ rich:selectedclass="#{selectedClass}"
+ rich:highlightedclass="#{highlightedClass}"
+ rich:oncomplete="#{component.attributes['oncomplete']}"
+
rich:ajaxsingle="#{component.attributes['ajaxSingle']}">
<vcp:body />
</td>
</tr>