actually, if implemented properly EditPage should take IModel<Person> and not Person itself. so unless you typed Link you have IModel<?> that you have to cast to IModel<Person>
-igor On Thu, May 22, 2008 at 2: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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]