The code is pretty massive, would be tough to post all that here.
Basically, it's an integer backed DropDownChoice that has the word
'guest' tagged on to incrementing numbers (e.g. 1 - 10) in the label.
When I remove the word 'guest' in the label it works just fine. Did your
dropdown have integers as the labels or was there more?

It seems that the problem lies in the conversion, and that Wicket
somehow is trying to grab the label value and put it into the model.

If anyone has run into such a problem I'd appreciate any input.

Michael



-----Original Message-----
From: Doug Donohoe [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 09, 2008 8:41 AM
To: [email protected]
Subject: RE: DropDownChoice throws IllegalArgumentException with Integer
values


Post your code.  It's hard to guess w/out seeing the code.  I have an
integer-based drop down choice working well (I used that example as my
starting point).

-Doug


Michael Mehrle wrote:
> 
> Anyone? Was hoping for some input here ;-)
> 
> -----Original Message-----
> From: Michael Mehrle [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 08, 2008 6:35 PM
> To: [email protected]
> Subject: RE: DropDownChoice throws IllegalArgumentException with
Integer
> values
> 
> Okay, I just stepped through this and getting the feeling that
'somehow'
> the label is being passed on to the model. Now, if the label is '1' it
> works fine, but if it's '1 day', then I get that error.
> 
> The question here is: why is the label being passed back to the model?
> Doesn't make any sense - I'm using a ChoiceRenderer as such:
> 
> new ChoiceRenderer("label", "value")
> 
> Do I also need to add some kind of converter to properly assign the
> model?
> 
> Any input would be appreciated.
> 
> Michael
> 
> -----Original Message-----
> From: Michael Mehrle [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 08, 2008 5:19 PM
> To: [email protected]
> Subject: DropDownChoice throws IllegalArgumentException with Integer
> values
> 
> This is the error I'm getting:
> 
>  
> 
> [DEBUG LoadAdDataInterceptor] Loaded
> AdData:[EMAIL PROTECTED] 
> 
> [ERROR RequestCycle] Cannot format given Object as a Number 
> 
> java.lang.IllegalArgumentException: Cannot format given Object as a
> Number
> 
>             at java.text.DecimalFormat.format(DecimalFormat.java:480)
> 
>             at java.text.Format.format(Format.java:133)
> 
>             at
>
org.apache.wicket.util.convert.converters.AbstractNumberConverter.conver
> tToString(AbstractNumberConverter.java:109)
> 
>             at
>
org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyRe
> solverConverter.java:84)
> 
>  
> 
> I'm using List<SelectOption> to populate the DropDownChoice, as per
the
> online example:
> 
>  
> 
>
http://cwiki.apache.org/WICKET/another-dropdownchoice-example-by-adam.ht
> ml
> 
>  
> 
> The only change I made to SelectOption is to set the 'value' field to
an
> Integer (which I need for my model).
> 
>  
> 
> Anyone any ideas as to what's going on? I'm pretty sure I didn't swap
> the label/value pairs as the labels show up properly.
> 
>  
> 
> Thanks,
> 
>  
> 
> Michael
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/DropDownChoice-throws-IllegalArgumentException-wit
h-Integer-values-tp17139227p17150771.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to