I got a cast error , when i use customer IChoiceRender
class ColumnRender implements IChoiceRendererColumnInfo {
public Object getDisplayValue(ColumnInfo object) {
return object.getFormattedName();
}
public String getIdValue(ColumnInfo object, int index) {
return object.getId();
}
if i look at this:
new DropDownChoiceColumnInfo
(form, columnId,
columnMangerService.selectAllColumnInfo(), new ColumnRender());
then it seems to me that columnId is a id (integer)
So it doesn't hold a ColumnInfo object but the id of that object.
Then your choice renderer is wrong.
Hi,johan
y, your right, the column id is string object, render is always get a string
object in this case.
I first use expression for default Render, and get the same error.
show you the complete stacktrace
WicketMessage: Exception in rendering component: [MarkupContainer [Component id
=
your model object must be of the same type as the object in the choices list
ie
DropDownChoiceT(WebMarkupContainer, String, IModelT, IModelListT,
IChoiceRendererT)
so if your model is String then the list of choices you pass in must be
ListString
-igor
On 1/8/07, tooy li(Gmail) [EMAIL