Generics question

2009-03-13 Thread Linda van der Pal
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 IModelListSubgenre subgenreModel = new AbstractReadOnlyModelListSubgenre() { ... } // Here I try to use the model FieldSwitchPanel subgenrefield =

Re: Generics question

2009-03-13 Thread Erik van Oosten
Hi Linda, You are assuming that IModelListSubgenre is a subtype of IModelList? extends DomainObject In java this is not the case (even if Subgenre extends DomainObject). You'll need an explicit cast to make this work: IModelList? extends DomainObject castedModel = (IModelList?

Re: Generics question

2009-03-13 Thread Olivier Michallat
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 IModelList? extends DomainObject doesn't work as we intuitively expect it to. It won't match IModelListSubgenre (nor

Re: Generics question

2009-03-13 Thread Linda van der Pal
Thanks! Erik van Oosten wrote: Hi Linda, You are assuming that IModelListSubgenre is a subtype of IModelList? extends DomainObject In java this is not the case (even if Subgenre extends DomainObject). You'll need an explicit cast to make this work: IModelList? extends DomainObject

Wicket 1.4 generics question

2008-05-18 Thread Frits Jalvingh
Hello there, I'm a Wicket Virgin (hm ;-) and have just started to look at Wicket 1.4. It seems something is wrong with the generics changes there. I have a page which itself has a model: a CompoundPropertyModelSomeClass. Most basic Wicket components are generic: things like Label need a type

Re: Wicket 1.4 generics question

2008-05-18 Thread Igor Vaynberg
page was not yet generified in m1, which is what i assume you are using. 1.4m2 will be out shortly where this has been corrected, and you can always use a snapshot. -igor On Sun, May 18, 2008 at 3:14 PM, Frits Jalvingh [EMAIL PROTECTED] wrote: Hello there, I'm a Wicket Virgin (hm ;-) and