I started getting these as soon as I have used latest wicket trunk in my
project:
Caused by: java.lang.IllegalArgumentException: converter can not convert
com.mobilebox.pfs.ranking.model.Sex to a string
at
org.apache.wicket.markup.html.form.AbstractChoice.appendOptionHtml(AbstractChoice.java:392)
at
org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:361)
at org.apache.wicket.Component.renderComponent(Component.java:2531)
This leads to:
protected void appendOptionHtml(AppendingStringBuffer buffer, E choice,
int index,
String selected)
{
T objectValue = (T)renderer.getDisplayValue(choice);
Class<T> objectClass = (Class<T>)(objectValue == null ? null :
objectValue.getClass());
String displayValue = "";
if (objectClass != null && objectClass != String.class)
{
final IConverter<T> converter =
this.getConverter(objectClass);
if (!converter.getClass().isAssignableFrom(objectClass))
throw new IllegalArgumentException("converter can
not convert " +
objectClass.getName() + " to a string");
displayValue = converter.convertToString(objectValue,
getLocale());
}
The check does not seem correct. How can converter class be ever
assignable to an model object class? Or am I missing something?
--
Leszek Gawron http://www.mobilebox.pl/krs.html
CTO at MobileBox Ltd.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]