Author: ehillenius
Date: Sun Aug 12 23:08:07 2007
New Revision: 565250

URL: http://svn.apache.org/viewvc?view=rev&rev=565250
Log:
WICKET-839 (rollback)

Modified:
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java?view=diff&rev=565250&r1=565249&r2=565250
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
 Sun Aug 12 23:08:07 2007
@@ -483,20 +483,24 @@
         */
        public boolean checkRequired()
        {
-               final String input = getInput();
-
-               // when null, check whether this is natural for that component, 
or
-               // whether - as is the case with text fields - this can only 
happen
-               // when the component was disabled
-               if (input == null && !isInputNullable())
+               if (isRequired())
                {
-                       // this value must have come from a disabled field
-                       // do not perform validation
-                       return true;
-               }
+                       final String input = getInput();
 
-               // peform validation by looking whether the value is null or 
empty
-               return !Strings.isEmpty(input);
+                       // when null, check whether this is natural for that 
component, or
+                       // whether - as is the case with text fields - this can 
only happen
+                       // when the component was disabled
+                       if (input == null && !isInputNullable())
+                       {
+                               // this value must have come from a disabled 
field
+                               // do not perform validation
+                               return true;
+                       }
+
+                       // peform validation by looking whether the value is 
null or empty
+                       return !Strings.isEmpty(input);
+               }
+               return true;
        }
 
        /**
@@ -1370,7 +1374,7 @@
         */
        protected final void validateRequired()
        {
-               if (isRequired() && !checkRequired())
+               if (!checkRequired())
                {
                        reportRequiredError();
                }


Reply via email to