Author: Alex.Kolonitsky
Date: 2009-06-05 06:25:37 -0400 (Fri, 05 Jun 2009)
New Revision: 14531
Modified:
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
Log:
Tree/TreeNode: process attribute doesn't work
https://jira.jboss.org/jira/browse/RF-7323
Modified:
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
---
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2009-06-04
23:06:46 UTC (rev 14530)
+++
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2009-06-05
10:25:37 UTC (rev 14531)
@@ -28,6 +28,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.ScriptUtils;
@@ -97,7 +98,7 @@
context);
Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context,
nodeFacet);
- Map<Object, Object> parameters = (Map<Object, Object>)
eventOptions.get("parameters");
+ Map<String, Object> parameters = (Map<String, Object>)
eventOptions.get("parameters");
parameters.remove(id);
parameters.put(id + NODE_EXPANDED_INPUT_SUFFIX, String.valueOf(!expanded));
@@ -261,7 +262,7 @@
String nodeExpandedId = id + NODE_EXPANDED_INPUT_SUFFIX;
Object nodeExpandedValue = requestMap.get(nodeExpandedId);
if (nodeExpandedValue != null) {
- boolean nodeExpanded = Boolean.valueOf(nodeExpandedValue.toString()).booleanValue();
+ boolean nodeExpanded = Boolean.valueOf(nodeExpandedValue.toString());
if (tree.isExpanded() ^ nodeExpanded) {
if (nodeExpanded) {
new ExpandNodeCommandEvent(tree, key).queue();
@@ -269,7 +270,7 @@
new CollapseNodeCommandEvent(tree, key).queue();
}
- if (Boolean.valueOf((String) requestMap.get(id +
AJAX_EXPANDED_SUFFIX)).booleanValue()) {
+ if (Boolean.valueOf((String) requestMap.get(id + AJAX_EXPANDED_SUFFIX))) {
new AjaxExpandedEvent(node).queue();
new AjaxExpandedEvent(tree).queue();
} else {
@@ -279,8 +280,7 @@
}
}
- if (id.equals(tree.getAttributes()
- .get(UITree.SELECTION_INPUT_ATTRIBUTE))) {
+ if (id.equals(tree.getAttributes().get(UITree.SELECTION_INPUT_ATTRIBUTE))) {
if (!componentState.isSelected(key)) {
if (tree.getAttributes().get(
@@ -297,6 +297,11 @@
tree.getAttributes().remove(UITree.SELECTION_INPUT_ATTRIBUTE);
}
+ if (AjaxRendererUtils.isAjaxRequest(context)) {
+ AjaxContext.getCurrentInstance(context)
+ .addAreasToProcessFromComponent(context, node);
+ }
+
super.doDecode(context, component);
}