That's exactly what I do now (wrapped model). Just wondering if there was a 
technical reason behind it. 

Sent via BlackBerry from T-Mobile

-----Original Message-----
From: Pedro Santos <pedros...@gmail.com>
Date: Mon, 25 Jan 2010 13:03:16 
To: <users@wicket.apache.org>
Subject: Re: Generics

Basically the list view depend from List interface due some calls to his
get(index) method. It means that the order of the components on the
collections, are meaninful to the component. If it is not your case (order,
item indexes doesn't matters), you can use an wrapper model in an list view,
like:

WrapperModel implements IModel
{
public WrapperModel (IModel wrappedModel)
{
this.wrappedModel = wrappedModel;
}
public Object getObject()
{
return new ArrayList(wrappedModel.getObject());
}

}

then you can create an  list view like:
new ListView("id", new PropertyModel(bean, "listPropertyFromThatBean"))

On Mon, Jan 25, 2010 at 12:29 PM, Sam Barrow <s...@sambarrow.com> wrote:

> I've noticed in some places where generics wildcards may be useful that
> they are not used. For example, in IColumn.
> If I have a Type and a SubType that extends Type, I can't use
> IColumn<Type> in a DataTable<SubType>. Is there any reason for this or
> was it just not implemented? Not the most necessary feature, but it
> couldn't hurt.
>
> Also is there a reason ListView and similar components require an
> IModel<List>, and will not accept an IModel<Collection>?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Reply via email to