Hi All

This is related to validating two types of Form components with Wicket 1.4.9

1.Validating a TextArea using the StringValidator to check for a min and max
   studyDescriptionTxtArea.add(StringValidator.lengthBetween(1, 255));

When I tested with a text content that triggers this validation, the error
message reported displays the content of the Text Area  that was entered
followed by
the error message..e.g Output:
All the text from studyDescriptionTxtArea + is not between 1 and 255
characters long.The user woudn't  want it to repeat the content on the
feedback panel.

Where have i gone wrong and what is involved in resolving it?

2. Validating a Date Field to report if the date entered is in the future.

   dateOfApplicationDp.setLabel( new
StringResourceModel("error.study.doa.max.range",this, null));
   dateOfApplicationDp.add(DateValidator.maximum(new Date()));//I could
format this date to a dd/mm/yyy but just for the test

   The resource key has the field name: i.e Date Of Application

   However I get the following message:

   07/24/2010' is larger than the maximum of Thu Jul 22 12:03:00 WST 2010.

   It is correct but would like to control this prefixed with the Field Name
also how can I add the custom error message and not just the label? i.e Date
Of Application cannot be in the future and override what Wicket Validator

Thanks for the time


Reply via email to