Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
$ svn info
Pfad: .
URL: https://svn.apache.org/repos/asf/incubator/wicket/trunk/jdk-1.5/wicket-examples
Basis des Projektarchivs: https://svn.apache.org/repos/asf
UUID des Projektarchivs: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 534415
Description
Trying to circle in https://issues.apache.org/jira/browse/WICKET-500 this one popped up:
org.apache.wicket.extensions.yui.calendar.DateTimeField; doesn't validate
Down below is a patch of FormInput of wicket-examles that attaches a DateRangeValidator to DateTimeField.
With this patch only the current Date (or maybe not even that) should be valid. But the opposite is true, any Date seem to be accepted by the form.
The stacktrace in the debugger shows that DateValidator.onValidate(IValidateable validatable) is never called,
since validatable.getValue() in:
RangeValidator(AbstractValidator).validate(IValidatable) line: 79
returns null.
Could it bee that the Validator is validating DateTimeField's value wereas it should validate it's DateTextField value?
mf
Index: src/main/java/org/apache/wicket/examples/forminput/FormInput.java
===================================================================
— src/main/java/org/apache/wicket/examples/forminput/FormInput.java (Revision 534415)
+++ src/main/java/org/apache/wicket/examples/forminput/FormInput.java (Arbeitskopie)
@@ -19,6 +19,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
+import java.util.Date;
import java.util.List;
import java.util.Locale;
@@ -49,6 +50,7 @@
import org.apache.wicket.util.convert.ConversionException;
import org.apache.wicket.util.convert.IConverter;
import org.apache.wicket.util.convert.MaskConverter;
+import org.apache.wicket.validation.validator.DateValidator;
import org.apache.wicket.validation.validator.NumberValidator;
@@ -96,7 +98,7 @@
add(integerTextField.add(NumberValidator.POSITIVE));
add(new RequiredTextField("doubleProperty", Double.class));
- add(new DateTimeField("dateProperty"));
+ add(new DateTimeField("dateProperty").add(DateValidator.range(new Date(), new Date())));
// add(DateTextField.forShortStyle("dateProperty").add(new
// DatePicker()));
Attachments
Issue Links
- is related to
-
WICKET-500 org.apache.wicket.extensions.yui.calendar.DateField; throws NPE upon validation.
- Resolved