Yeah that is the problem with Generics You cant say take the <T> from the model you get in the constructor Then everything would be perfect.
But i really dont think that <Person> in link is redundant why is it? You call later on getModelObject() on it.. so you use the model/modelobject of Link so you need to say what Link has.. johan On Thu, May 22, 2008 at 11:45 AM, Jan Kriesten <[EMAIL PROTECTED]> wrote: > > Hi Johan, > > I thing that the example below is exactly the thing that generics are >> pretty >> good: >> >> populateItem(ListItem<Person> item) { >> add(new Link<Person>("edit", item.getModel()) { >> public void onClick() { >> setResponsePage(new EditPage(getModelObject())); >> } >> }); >> >> (and EditPage is by itself already generified to <Person>) >> > > well, just that the Link<Person> is IMHO redundant and unnecessary(just > dropped a note to Martijn, but since you brought that up...) > > populateItem(final ListItem<Person> item) { > item.add(new Link("edit") { > public void onClick() { > setResponsePage(new EditPage(item.getModelObject())); > } > }); > > So, it might have sense with ListItem, but not necissarily with Link... > > Regards, --- Jan. > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >