2

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?

laurt
  • 1,811
  • 3
  • 15
  • 18

4 Answers4

4

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

Community
  • 1
  • 1
Imperative
  • 3,138
  • 2
  • 25
  • 40
3

Create a properties file and specify your own message:

TextField.age=Your custom message

More info about properties here and here

Martin
  • 1,274
  • 12
  • 23
2

Add age.IConverter.Integer = Your Custom Message to your properties file

1

What worked for me was adding this to the properties file:

<entry key="IConverter.Integer">${label} must be an integer.</entry>
laurt
  • 1,811
  • 3
  • 15
  • 18