I have TextField that should take Long value, but on submit it does not
really work...


org.apache.wicket.RequestCycle logRuntimeException: Exception
'java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.lang.Long' occurred during validation
org.apache.wicket.validation.validator.MinimumValidator on component
10:workForm:hire_worker_1
org.apache.wicket.WicketRuntimeException: Exception
'java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.lang.Long' occurred during validation
org.apache.wicket.validation.validator.MinimumValidator on component
10:workForm:hire_worker_1


My code looks like that:

public Work() {
                add(new FeedbackPanel("errorMsg"));
                Form<String> workForm = new Form<String>("workForm", new 
Model<String>())
{
                        private TextField<Long> hire_worker_1 = new
TextField<Long>("hire_worker_1", new Model<Long>());
...
{
...
add(hire_worker_1.add(new MinimumValidator(0))
                                                .setType(Long.class));
...
}

@Override
                public void onSubmit() {
                        long hiring_worker_1 = hire_worker_1.getModelObject();
                        ...
}
        };
        add(workForm);
        }

Eclipse does like "new MinimumValidator<Long>(0)", so what's the solution
for my problem?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MinimumValidator-and-Long-problem-tp2992468p2992468.html
Sent from the Users forum 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

Reply via email to