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]