RE: TextField and Java Number

2011-06-15 Thread Corbin, James
Good point.  Number is not the appropriate type in this case.  I think I should

-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  wrote:
> I am creating an input field that should accept numbers only, so I defined my 
> TextField component as follows,
>
> TextField(String markupId, IModel 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).
>
> I am wondering if the alternate constructor format is required to make it 
> work with types not derived from a String, as in,
>
> TextField(String markupId, IModel 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



RE: TextField and Java Number

2011-06-15 Thread Corbin, James
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  wrote:
> I am creating an input field that should accept numbers only, so I defined my 
> TextField component as follows,
>
> TextField(String markupId, IModel 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).
>
> I am wondering if the alternate constructor format is required to make it 
> work with types not derived from a String, as in,
>
> TextField(String markupId, IModel 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



Re: TextField and Java Number

2011-06-15 Thread James Carman
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  wrote:
> I am creating an input field that should accept numbers only, so I defined my 
> TextField component as follows,
>
> TextField(String markupId, IModel 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).
>
> I am wondering if the alternate constructor format is required to make it 
> work with types not derived from a String, as in,
>
> TextField(String markupId, IModel 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