You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Frank Tegtmeyer <Fr...@online-systemhaus.com> on 2009/05/25 12:54:03 UTC

Generics in components

Hi,

I am still very very new to Java and Wicket of course too,
so excuse me if this is a dumb question.

I swiched my project to Wicket 1.4-rc4 now and got all these
wonderful warnings about the "Raw types" of the components
in my sources.
Are there any examples that highlight the handling of
the generic component types? I have no clue what type parameter
I have to give a form component for example (no clue for other
components too). Should it be the class of my model or anything
else? For validators I tried to set base types (Integer, ..)
and this worked. But still I have no clue if this is the right
thing to do.

Confused ... :)

Regards, Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Generics in components

Posted by James Carman <jc...@carmanconsulting.com>.
On Mon, May 25, 2009 at 6:54 AM, Frank Tegtmeyer
<Fr...@online-systemhaus.com> wrote:
> Hi,
>
> I am still very very new to Java and Wicket of course too,
> so excuse me if this is a dumb question.
>
> I swiched my project to Wicket 1.4-rc4 now and got all these
> wonderful warnings about the "Raw types" of the components
> in my sources.
> Are there any examples that highlight the handling of
> the generic component types? I have no clue what type parameter
> I have to give a form component for example (no clue for other
> components too). Should it be the class of my model or anything
> else? For validators I tried to set base types (Integer, ..)
> and this worked. But still I have no clue if this is the right
> thing to do.
>
> Confused ... :)

The type parameter on components is supposed to correspond to their
model's type parameter.  So,  TextField<Integer> would need an
IModel<Integer>.  The Wicket test cases should have examples of this,
if nothing else.

Use the source, Luke.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org