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
|