Thanks!

Erik van Oosten wrote:
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


------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 8.5.278 / Virus Database: 270.11.13/1999 - Release Date: 03/13/09 05:59:00



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to