Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Wicket text field validation error message

Tags:

wicket

I have a text field that uses a PropertyModel, like this:

TextField<Integer> ageField = new TextField<Integer>("age", 
                      new PropertyModel<Integer>(person, "age"));

When a non-integer value is submitted, the following error is displayed in the browser:

"The value of 'age' is not a valid Integer."

How can I modify this error message?

like image 218
laurt Avatar asked May 01 '26 22:05

laurt


1 Answers

In Wicket 6 you need to set up a properties file with the inputs Wicket-ID appended by .Required:

myinput.Required = Please provide this input field

Define own feedback messages in Wicket

like image 155
Imperative Avatar answered May 03 '26 23:05

Imperative



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!