LOL...good point...so the type Number.class was probably a bad choice :) I'm 
going with a BigDecimal as my type as that should support all my needs.

Thanks,
J.D.

-----Original Message-----
From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On 
Behalf Of James Carman
Sent: Wednesday, June 15, 2011 3:30 PM
To: users@wicket.apache.org
Subject: Re: TextField and Java Number

Number is abstract.  How is TextField supposed to be able to
instantiate one using the text?  You can't use one of the subclasses?

On Wed, Jun 15, 2011 at 5:20 PM, Corbin, James <jcor...@iqnavigator.com> wrote:
> I am creating an input field that should accept numbers only, so I defined my 
> TextField component as follows,
>
> TextField<Number>(String markupId, IModel<Number> model)
>
> I am "forcing" the model update by adding 
> AjaxFormComponentUpdatingBehavior("onblur")...
>
> The model doesn't appear to be getting updated (works okay if defined as 
> TextField<String>).
>
> I am wondering if the alternate constructor format is required to make it 
> work with types not derived from a String, as in,
>
> TextField<Number>(String markupId, IModel<Number> model, Number.class)  // 
> explicitly specify the type
>
> I thought moving to support generics in wicket eliminated the need for this 
> kind of syntax.
>
> Is specifying the type (e.g., class) the solution,  or do I need to add a 
> specific type converter for type Number???
>
> Thanks,
> J.D.
>

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


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

Reply via email to