Hi Linda,

You are assuming that
  IModel<List<Subgenre>>
is a subtype of
  IModel<List<? extends DomainObject>>

In java this is not the case (even if Subgenre extends DomainObject). You'll need an explicit cast to make this work:
 IModel<List<? extends DomainObject>> castedModel =
        (IModel<List<? extends DomainObject>>) subgenreModel;

Regards,
   Erik.


Linda van der Pal wrote:
This is not really Wicket related, but I don't quite know where else to ask this. The question is: why won't this compile?

// I define a model
IModel<List<Subgenre>> subgenreModel = new AbstractReadOnlyModel<List<Subgenre>>() {
   ...
}

// Here I try to use the model
FieldSwitchPanel subgenrefield = *new SubgenreFieldSwitchPanel("subgenre", subgenreModel);*


// This is the constructor for the class SubgenreFieldSwithcPanel
public SubgenreFieldSwitchPanel(String id, IModel<List<? extends DomainObject>> choices) {
   ...
}


// Subgenre extends DomainObject
public class Subgenre extends DomainObject{
   ...
}


The complaint is: The constructor SubgenreFieldSwitchPanel(String, IModel<List<Subgenre>>) is undefined.

Thanks,
Linda


--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to