You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by me...@apache.org on 2009/04/28 14:27:50 UTC
svn commit: r769366 -
/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FieldColumn.java
Author: medgar
Date: Tue Apr 28 12:27:49 2009
New Revision: 769366
URL: http://svn.apache.org/viewvc?rev=769366&view=rev
Log:
have setProperty method use PropertyUtils for OGNL expression caching
Modified:
incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FieldColumn.java
Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FieldColumn.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FieldColumn.java?rev=769366&r1=769365&r2=769366&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FieldColumn.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FieldColumn.java Tue Apr 28 12:27:49 2009
@@ -20,12 +20,15 @@
import java.util.HashMap;
import java.util.Map;
-import ognl.Ognl;
+
+import ognl.OgnlException;
+
import org.apache.click.Context;
import org.apache.click.control.Column;
import org.apache.click.control.Field;
import org.apache.click.control.Form;
import org.apache.click.util.HtmlStringBuffer;
+import org.apache.click.util.PropertyUtils;
/**
* Provides a FieldColumn for rendering table data cells.
@@ -168,9 +171,7 @@
*
* @param row the row object to obtain the property from
* @param propertyName the name of the property
- * @param the row object property value
- *
- * @return the named row object property value
+ * @param value the row object property value
* @throws RuntimeException if an error occurred obtaining the property
*/
public void setProperty(Object row, String propertyName, Object value) {
@@ -179,19 +180,20 @@
if (map.containsKey(propertyName)) {
map.put(propertyName, value);
}
+
} else {
if (ognlContext == null) {
ognlContext = new HashMap();
}
try {
- Ognl.setValue(propertyName,
- ognlContext,
- row,
- value);
+ PropertyUtils.setValueOgnl(row,
+ propertyName,
+ value,
+ ognlContext);
- } catch (Exception e) {
- throw new RuntimeException(e);
+ } catch (OgnlException oe) {
+ throw new RuntimeException(oe);
}
}
}