I am getting a ClassCastException when using RangeValidator like this:

RequiredTextField<Integer> intField = new RequiredTextField<Integer>("intField");
intField.add(new RangeValidator(0, 100));

or like this:

RequiredTextField<Integer> intField = new RequiredTextField<Integer>("intField");
intField.add(new RangeValidator<Integer>(0, 100));


WicketMessage: Exception 'java.lang.ClassCastException: java.lang.Integer' occurred during validation org.apache.wicket.validation.validator.RangeValidator on component 2:body:recvAnalisysForm:intField Root cause:java.lang.ClassCastException: java.lang.Integer at java.lang.String.compareTo(String.java:90)

The example app shows it coded this way, but NumberValidator has been deprecated.

add(new RequiredTextField<Integer>("integerInRangeProperty").add(NumberValidator.range(0, 100)));

What is the correct way of using RangeValidator and how do you type it?

Warren

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

Reply via email to