Return-Path: Delivered-To: apmail-click-commits-archive@www.apache.org Received: (qmail 768 invoked from network); 14 Mar 2010 02:20:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Mar 2010 02:20:00 -0000 Received: (qmail 74407 invoked by uid 500); 14 Mar 2010 02:19:19 -0000 Delivered-To: apmail-click-commits-archive@click.apache.org Received: (qmail 74388 invoked by uid 500); 14 Mar 2010 02:19:19 -0000 Mailing-List: contact commits-help@click.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@click.apache.org Delivered-To: mailing list commits@click.apache.org Received: (qmail 74380 invoked by uid 99); 14 Mar 2010 02:19:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Mar 2010 02:19:18 +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; Sun, 14 Mar 2010 02:19:17 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E1F372388A43; Sun, 14 Mar 2010 02:18:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r922727 - in /click/trunk/click: documentation/docs/roadmap-changes.html framework/src/org/apache/click/control/Field.java framework/test/org/apache/click/control/FieldTest.java framework/test/org/apache/click/control/TextFieldTest.java Date: Sun, 14 Mar 2010 02:18:56 -0000 To: commits@click.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100314021856.E1F372388A43@eris.apache.org> Author: sabob Date: Sun Mar 14 02:18:56 2010 New Revision: 922727 URL: http://svn.apache.org/viewvc?rev=922727&view=rev Log: added Field trim property. CLK-627 Removed: click/trunk/click/framework/test/org/apache/click/control/FieldTest.java Modified: click/trunk/click/documentation/docs/roadmap-changes.html click/trunk/click/framework/src/org/apache/click/control/Field.java click/trunk/click/framework/test/org/apache/click/control/TextFieldTest.java Modified: click/trunk/click/documentation/docs/roadmap-changes.html URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/roadmap-changes.html?rev=922727&r1=922726&r2=922727&view=diff ============================================================================== --- click/trunk/click/documentation/docs/roadmap-changes.html (original) +++ click/trunk/click/documentation/docs/roadmap-changes.html Sun Mar 14 02:18:56 2010 @@ -129,17 +129,26 @@ includes improved Ajax support and @Bind
  • Added methods to Fields for styling their labels. See new methods Field.setLabelStyle(String) - and Field.setLabelStyleClass(String) + and Field.setLabelStyleClass(String). + This issue was raised by Stefax [CLK-595].
  • Added methods to Fields for providing styling hints to their containing elements. See new methods Field.setParentStyleHint(String) - and Field.setParentStyleClassHint(String) + and Field.setParentStyleClassHint(String). + This issue was raised by Stefax [CLK-595].
  • + Added trim property to Field for controlling if the Field request + parameter is trimmed or not. See new method + Field.setTrim(boolean). + This issue was raised by Andrey Rybin + [CLK-627]. +
  • +
  • Added new Context methods Context.hasRequestParameter(String) and Context.hasRequestAttribute(String). @@ -150,7 +159,8 @@ includes improved Ajax support and @Bind
  • Replaced multiple ClickUtils close methods with a single method accepting - a Closeable + a Closeable. + This issue was raised by Andrey Rybin [CLK-620].
  • Modified: click/trunk/click/framework/src/org/apache/click/control/Field.java URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/Field.java?rev=922727&r1=922726&r2=922727&view=diff ============================================================================== --- click/trunk/click/framework/src/org/apache/click/control/Field.java (original) +++ click/trunk/click/framework/src/org/apache/click/control/Field.java Sun Mar 14 02:18:56 2010 @@ -229,8 +229,11 @@ public abstract class Field extends Abst /** The Field 'title' attribute, which acts as a tooltip help message. */ protected String title; + /** The Field is trimmed flag, default value is true. */ + protected boolean trim = true; + /** - * The validate Field value onProcess() invokation flag. + * The validate Field value onProcess() invocation flag. */ protected Boolean validate; @@ -856,6 +859,27 @@ public abstract class Field extends Abst } /** + * Return true if the Field request value should be trimmed, false otherwise. + * The default value is "true". + * + * @return true if the Field request value should be trimmed, false otherwise + */ + public boolean isTrim() { + return trim; + } + + /** + * Set the trim flag to true if the Field request value should be trimmed, + * false otherwise. + * + * @param trim true if the Field request value should be trimmed, false + * otherwise + */ + public void setTrim(boolean trim) { + this.trim = trim; + } + + /** * Return true if the Field should validate itself when being processed. *

    * If the validate attribute for the Field is not explicity set, this @@ -1173,7 +1197,11 @@ public abstract class Field extends Abst protected String getRequestValue() { String value = getContext().getRequestParameter(getName()); if (value != null) { - return value.trim(); + if (isTrim()) { + return value.trim(); + } else { + return value; + } } else { return ""; } Modified: click/trunk/click/framework/test/org/apache/click/control/TextFieldTest.java URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/control/TextFieldTest.java?rev=922727&r1=922726&r2=922727&view=diff ============================================================================== --- click/trunk/click/framework/test/org/apache/click/control/TextFieldTest.java (original) +++ click/trunk/click/framework/test/org/apache/click/control/TextFieldTest.java Sun Mar 14 02:18:56 2010 @@ -103,4 +103,151 @@ public class TextFieldTest extends TestC // Check that the value