[ 
https://issues.apache.org/jira/browse/WICKET-6534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sven Meier resolved WICKET-6534.
--------------------------------
    Resolution: Invalid
      Assignee: Sven Meier

Your RequiredTextField does not know the type of your model object, so String 
is used as fallback.

Either you use a model that provides this type information (e.g. 
PropertyModel), or you'll have to pass the type to the constructor explicitly:
{code:java}
new RequiredTextField<>("ho",new Model<Integer>(month), Integer.class);{code}

> RangeValidator throws java.lang.Integer cannot be cast to java.lang.String 
> exception
> ------------------------------------------------------------------------------------
>
>                 Key: WICKET-6534
>                 URL: https://issues.apache.org/jira/browse/WICKET-6534
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 7.9.0
>            Reporter: Sandor Feher
>            Assignee: Sven Meier
>            Priority: Major
>
> Hi,
> I have an Integer field (month) which need to be verified by RangeValidator 
> but in 7.9.0 it throws exception,
> Last cause: java.lang.Integer cannot be cast to java.lang.String
> WicketMessage: Exception 'java.lang.Integer cannot be cast to 
> java.lang.String' occurred during validation 
> org.apache.wicket.validation.validator.RangeValidator on component 2:form:ho
> I created a quickstart for this issue: 
> https://github.com/sfeher/rangevalidatorquickstart



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to