Thanks for your quick response. But I have already tried to add needed type,
e.g. <String> and got the error.
I suppose the case is not so simple.
IModel<List<String>> allYearsModel = new PropertyModel<List<String>>(this,
"selectedYears");
ListMultipleChoice<String> allYears = new
ListMultipleChoice<String>("allYears", allYearsModel, new
ArrayList<String>());
gives error:
"The constructor ListMultipleChoice<String>(String, IModel<List<String>>,
ArrayList<String>) is undefined"
Should it not be a valid constructor for:
ListMultipleChoice(java.lang.String id, IModel<java.util.Collection<T>>
object, java.util.List<T> choices)
When I use constructor without IModel, all is OK:
ListMultipleChoice<String> allYears = new
ListMultipleChoice<String>("allYears", new ArrayList<String>());
When I look at DropDownChoice it works with similar constructor, e.g.,
IModel<String> allYearsModel = new PropertyModel<String>(this,
"selectedYears");
DropDownChoice<String> placeDdc = new DropDownChoice<String>("place",
allYearsModel, new ArrayList<String>());
I can not figure out, why so.
Juris
On 27 February 2010 00:15, Igor Vaynberg <[email protected]> wrote:
> ListMultipleChoice<String> tmp = new ListMultipleChoice<String>(...
>
> -igor
>
> On Fri, Feb 26, 2010 at 2:07 PM, Juris Maskalans <[email protected]>
> wrote:
> > Hi,
> >
> > I have a question regarding ListMultipleChoice.
> > How to overcome generic warning.
> > "ListMultipleChoice is a raw type. References to generic type
> > ListMultipleChoice<T> should be parameterized"
> >
> > Despite of this the code works fine:
> > ListMultipleChoice tmp = new ListMultipleChoice("tmp", new
> > PropertyModel<List<String>>(
> > this, "selectedYears"), new ArrayList<String>());
> >
> > Thanks!
> > Juris
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>