Well, from the looks of it it's a bit odd that you write

new CompoundPropertyModel<ReportWebModel>(reportWebModel)

instead of

new CompoundPropertyModel<Report>(reportWebModel)

since ReportWebModel extends BaseWebModel<Report>

The CPM constructor expects either a type literal or a model. In your case it is both, and you tell the CPM (through the generic type) that you will provide a type literal.

Does your CPM have to be of type <ReportWebModel>?

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 25-1-2013 12:02, schreef Pieter Claassen:
When I try to create the following model after migrating to wicket 6.5.0

new CompoundPropertyModel<ReportWebModel>(reportWebModel)

*where*

ReportWebModel extends BaseWebModel<Report>

*and*

BaseWebModel<T> implements IModel

My IDE (Intellij) shows no problem with type checking the code but when I
try to compile it I get:

java: reference to CompoundPropertyModel is ambiguous, both constructor
CompoundPropertyModel(org.apache.wicket.model.IModel<T>) in
org.apache.wicket.model.CompoundPropertyModel and constructor
CompoundPropertyModel(T) in org.apache.wicket.model.CompoundPropertyModel
match

The problem goes away when I remove the generics but then I also lose the
type checking.

Any suggestions?

Thanks,
Pieter


Reply via email to