how about new MaximumValidator<Integer>(value)?

-- 
Jeremy Thomerson
http://www.wickettraining.com
On Tue, Nov 18, 2008 at 11:37 AM, Adriano dos Santos Fernandes <
[EMAIL PROTECTED]> wrote:

> I had this in 1.4-m3 working:
>   long value = ...;
>   textField.add(NumberValidator.maximum(value));
>
> My textField is instantiated as TextField<Integer> and declared as
> TextField<?>, so I put a long validation for a Integer TextField. It also
> works in 1.4-rc1, but NumberValidator is deprecated.
>
> So I had replaced it:
>   textField.add(new MaximumValidator(value));
>
> It caused a warning and assumes a MaximumValidator<Long>. This code caused
> a runtime exception:
>   WicketMessage: Exception 'java.lang.ClassCastException: java.lang.Long
> cannot be cast to java.lang.Integer' occurred during validation ...
>
> How could I have this type of validator? I tried a MaximumValidator<Number>
> but it's not compilable.
>
>
> Adriano
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to