Author: Alex.Kolonitsky
Date: 2009-09-10 04:21:49 -0400 (Thu, 10 Sep 2009)
New Revision: 15521
Modified:
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/component/UITreeNode.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/component/UITreeNode.java
===================================================================
---
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java 2009-09-10
08:09:00 UTC (rev 15520)
+++
branches/community/3.3.X/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java 2009-09-10
08:21:49 UTC (rev 15521)
@@ -20,7 +20,9 @@
*/
package org.richfaces.component;
+import javax.el.ELException;
import javax.el.ValueExpression;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIViewRoot;
@@ -77,6 +79,9 @@
private boolean ignoreDupResponsesSet = false;
private boolean timeoutSet = false;
+ private Object process = null;
+ private boolean processSet = false;
+
public static final String COMPONENT_TYPE = "org.richfaces.TreeNode";
public static final String COMPONENT_FAMILY = "org.richfaces.TreeNode";
@@ -348,7 +353,7 @@
}
public Object saveState(FacesContext context) {
- Object[] state = new Object[18];
+ Object[] state = new Object[20];
state[0] = super.saveState(context);
state[1] = this.dragType;
state[2] = this.acceptedTypes;
@@ -367,6 +372,8 @@
state[15] = new Integer(this.timeout);
state[16] = this.similarityGroupingId;
state[17] = new Boolean(this.bypassUpdates);
+ state[18] = this.process;
+ state[19] = Boolean.valueOf(this.processSet);
return state;
}
@@ -391,6 +398,8 @@
this.timeout = ((Integer)_state[15]).intValue();
this.similarityGroupingId = (String) _state[16];
this.bypassUpdates = ((Boolean)_state[17]).booleanValue();
+ this.process = _state[18];
+ this.processSet = ((Boolean)_state[19]).booleanValue();
}
public void setDragIndicator(String dragIndicator) {
@@ -549,6 +558,37 @@
}
}
+ public Object getProcess() {
+ if (this.process != null) {
+ return this.process;
+ }
+
+ ValueExpression ve = getValueExpression("process");
+ if (ve != null) {
+ Object value = null;
+
+ try {
+ value = (Object) ve.getValue(getFacesContext().getELContext());
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+
+ return value;
+ } else {
+ UITree tree = getUITree();
+ if (tree != null) {
+ return tree.getProcess();
+ }
+ }
+
+ return null;
+ }
+
+ public void setProcess(Object process) {
+ this.process = process;
+ this.processSet = true;
+ }
+
/**
* If "true", after process validations phase it skips updates of model beans
on a force render response. It can be used for validating components input
* Setter for bypassUpdates