This looks exactly like the DropDownChoice issue that has been debated
recently. See the comments in JIRA:
https://issues.apache.org/jira/browse/WICKET-2137

The problem is that IModel<List<? extends DomainObject>> doesn't work
as we intuitively expect it to. It won't match IModel<List<Subgenre>>
(nor IModel<List<DomainObject>> for that matter).

As suggested by James, the correct generic type to achieve what you
want to do would be: IModel<? extends List<? extends DomainObject>>


Olivier

2009/3/13 Linda van der Pal <[email protected]>:
> 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
>

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

Reply via email to