You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bs...@apache.org on 2007/10/31 05:55:43 UTC

svn commit: r590558 - in /commons/proper/validator/trunk/src/main: java/org/apache/commons/validator/Field.java resources/org/apache/commons/validator/resources/validator_1_4_0.dtd

Author: bspeakmon
Date: Tue Oct 30 21:55:42 2007
New Revision: 590558

URL: http://svn.apache.org/viewvc?rev=590558&view=rev
Log:
- VALIDATOR-232: applying Paul's patch at his request

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java
    commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java?rev=590558&r1=590557&r2=590558&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/Field.java Tue Oct 30 21:55:42 2007
@@ -104,6 +104,13 @@
     protected int page = 0;
     
     /**
+     * The flag that indicates whether scripting should be generated
+     * by the client for client-side validation.
+     * @since Validator 1.4
+     */
+    protected boolean clientValidation = true;
+    
+    /**
      * The order of the Field in the Form.
      */
     protected int fieldOrder = 0;
@@ -288,6 +295,28 @@
     }
 
     /**
+     * Determines whether client-side scripting should be generated
+     * for this field. The default is <code>true</code>
+     * @return <code>true</code> for scripting; otherwise false
+     * @see #setClientValidation(boolean)
+     * @since Validator 1.4
+     */
+    public boolean isClientValidation() {
+        return this.clientValidation;
+    }
+
+    /**
+     * Sets the flag that determines whether client-side scripting should 
+     * be generated for this field. 
+     * @param scripting the scripting flag
+     * @see #isClientValidation()
+     * @since Validator 1.4
+     */
+    public void setClientValidation(boolean clientValidation) {
+        this.clientValidation = clientValidation;
+    }
+
+    /**
      * Add an <code>Arg</code> to the replacement argument list.
      * @since Validator 1.1
      * @param arg Validation message's argument.
@@ -915,6 +944,5 @@
     protected Map getVarMap() {
         return hVars;
     }
-
 }
 

Modified: commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd?rev=590558&r1=590557&r2=590558&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd (original)
+++ commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd Tue Oct 30 21:55:42 2007
@@ -144,13 +144,16 @@
                      list and then loop through the list performing the
                      validations for this field.
 
+     scripting       If set to "false", the client is directed not to generate 
+                     any scripting for client-side validation.
+                     [true]
 -->
 <!ELEMENT field (msg|arg|var)*>
 <!ATTLIST field property CDATA #REQUIRED>
 <!ATTLIST field depends CDATA #IMPLIED>
 <!ATTLIST field page CDATA #IMPLIED>
 <!ATTLIST field indexedListProperty CDATA #IMPLIED>
-
+<!ATTLIST field clientValidation CDATA #IMPLIED>
 
 <!--
      Defines a custom message key to use when one of the



Re: [validator] svn commit: r590558 - in /commons/proper/validator/trunk/src/main: java/org/apache/commons/validator/Field.java resources/org/apache/commons/validator/resources/validator_1_4_0.dtd

Posted by Ben Speakmon <bs...@apache.org>.
Indeed it doesn't. Paul tricked me. :) I'll fix it.

On 10/30/07, Rahul Akolkar <ra...@gmail.com> wrote:
>
> On 10/31/07, bspeakmon@apache.org <bs...@apache.org> wrote:
> > Author: bspeakmon
> > Date: Tue Oct 30 21:55:42 2007
> > New Revision: 590558
> >
> > URL: http://svn.apache.org/viewvc?rev=590558&view=rev
> > Log:
> > - VALIDATOR-232: applying Paul's patch at his request
> >
> >
> <snip/>
> >
> > ---
> commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd
> (original)
> > +++
> commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd
> Tue Oct 30 21:55:42 2007
> > @@ -144,13 +144,16 @@
> >                       list and then loop through the list performing the
> >                       validations for this field.
> >
> > +     scripting       If set to "false", the client is directed not to
> generate
> > +                     any scripting for client-side validation.
> > +                     [true]
> <snap/>
>
> Attribute name in comment above doesn't match the one below.
>
> -Rahul
>
>
> >  -->
> >  <!ELEMENT field (msg|arg|var)*>
> >  <!ATTLIST field property CDATA #REQUIRED>
> >  <!ATTLIST field depends CDATA #IMPLIED>
> >  <!ATTLIST field page CDATA #IMPLIED>
> >  <!ATTLIST field indexedListProperty CDATA #IMPLIED>
> > -
> > +<!ATTLIST field clientValidation CDATA #IMPLIED>
> >
> >  <!--
> >       Defines a custom message key to use when one of the
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [validator] svn commit: r590558 - in /commons/proper/validator/trunk/src/main: java/org/apache/commons/validator/Field.java resources/org/apache/commons/validator/resources/validator_1_4_0.dtd

Posted by Rahul Akolkar <ra...@gmail.com>.
On 10/31/07, bspeakmon@apache.org <bs...@apache.org> wrote:
> Author: bspeakmon
> Date: Tue Oct 30 21:55:42 2007
> New Revision: 590558
>
> URL: http://svn.apache.org/viewvc?rev=590558&view=rev
> Log:
> - VALIDATOR-232: applying Paul's patch at his request
>
>
<snip/>
>
> --- commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd (original)
> +++ commons/proper/validator/trunk/src/main/resources/org/apache/commons/validator/resources/validator_1_4_0.dtd Tue Oct 30 21:55:42 2007
> @@ -144,13 +144,16 @@
>                       list and then loop through the list performing the
>                       validations for this field.
>
> +     scripting       If set to "false", the client is directed not to generate
> +                     any scripting for client-side validation.
> +                     [true]
<snap/>

Attribute name in comment above doesn't match the one below.

-Rahul


>  -->
>  <!ELEMENT field (msg|arg|var)*>
>  <!ATTLIST field property CDATA #REQUIRED>
>  <!ATTLIST field depends CDATA #IMPLIED>
>  <!ATTLIST field page CDATA #IMPLIED>
>  <!ATTLIST field indexedListProperty CDATA #IMPLIED>
> -
> +<!ATTLIST field clientValidation CDATA #IMPLIED>
>
>  <!--
>       Defines a custom message key to use when one of the
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org