Author: maksimkaszynski
Date: 2008-03-18 07:28:45 -0400 (Tue, 18 Mar 2008)
New Revision: 6895
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java
Log:
http://jira.jboss.com/jira/browse/RF-2348
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java 2008-03-18
11:17:53 UTC (rev 6894)
+++
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java 2008-03-18
11:28:45 UTC (rev 6895)
@@ -29,9 +29,9 @@
import javax.el.ELResolver;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-import javax.el.VariableMapper;
import javax.faces.application.Application;
import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import org.ajax4jsf.util.ELUtils;
@@ -54,7 +54,7 @@
private Expression [] expressions;
private FacesContext context;
private String var;
- private ValueExpression varValue;
+ private Object varValue;
public ObjectWrapperFactory(FacesContext context, final String var, SortOrder sortOrder)
{
@@ -147,21 +147,30 @@
}
});
- ELContext elContext = context.getELContext();
- VariableMapper mapper = elContext.getVariableMapper();
- mapper.setVariable(var, varValue);
+ Map<String, Object> requestMap = getRequestMap();
+ if (varValue == null) {
+ requestMap.remove(var);
+ } else {
+ requestMap.put(var, varValue);
+ }
return list;
}
+ /**
+ *
+ */
+ private Map<String, Object> getRequestMap() {
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+ return requestMap;
+ }
public Object unwrapObject(Object wrapper) {
return ((JavaBeanWrapper) wrapper).getWrappedObject();
}
public List<Object> wrapList(List<Object> list) {
- ELContext elContext = context.getELContext();
- VariableMapper mapper = elContext.getVariableMapper();
- varValue = mapper.resolveVariable(var);
+ varValue = getRequestMap().get(var);
convertList(list, new ObjectConvertor() {
public Object convert(Object o) {