Re: TextArea StringValidator and DateValidator

2010-07-22 Thread vov

Create XML file that named same with your class and put ot it

entry key=studyDescriptionTxtArea.StringValidator.rangeYOUR TEXT HERE is
not between ${minimum} and ${maximum} characters long/entry

instead studyDescriptionTxtArea must be wicket:id of your TextField
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Re-TextArea-StringValidator-and-DateValidator-tp2298113p2298722.html
Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: TextArea StringValidator and DateValidator

2010-07-22 Thread Nivedan Nadaraj
Thanks will try that. Cheers
Thanks for ut time
Cheers
Niv
On Thu, Jul 22, 2010 at 10:07 PM, vov vov...@mail.ru wrote:


 Create XML file that named same with your class and put ot it

 entry key=studyDescriptionTxtArea.StringValidator.rangeYOUR TEXT HERE
 is
 not between ${minimum} and ${maximum} characters long/entry

 instead studyDescriptionTxtArea must be wicket:id of your TextField
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Re-TextArea-StringValidator-and-DateValidator-tp2298113p2298722.html
 Sent from the Wicket - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: TextArea StringValidator and DateValidator

2010-07-21 Thread Nivedan Nadaraj
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
length.
   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
returns?

Thanks for the time

Regards
Niv