Return-Path: Delivered-To: apmail-incubator-click-commits-archive@minotaur.apache.org Received: (qmail 46954 invoked from network); 28 Apr 2009 12:28:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Apr 2009 12:28:12 -0000 Received: (qmail 8426 invoked by uid 500); 28 Apr 2009 12:28:11 -0000 Delivered-To: apmail-incubator-click-commits-archive@incubator.apache.org Received: (qmail 8413 invoked by uid 500); 28 Apr 2009 12:28:11 -0000 Mailing-List: contact click-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@incubator.apache.org Delivered-To: mailing list click-commits@incubator.apache.org Received: (qmail 8402 invoked by uid 99); 28 Apr 2009 12:28:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 12:28:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2009 12:28:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4119D238896C; Tue, 28 Apr 2009 12:27:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r769366 - /incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FieldColumn.java Date: Tue, 28 Apr 2009 12:27:50 -0000 To: click-commits@incubator.apache.org From: medgar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090428122750.4119D238896C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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); } } }