I've always handled the typing problem with DropDownChoice and my list models by "just ignoring it" and not applying type parameters to the DropDownChoice. This is because if I use the same IModel<List<? extends Foo>> for a ListView, then I get an error in the ListView's constructor. Is there a good solution for both, other that having two types of IModel<List<?>> for the same object, one with the "? extends" and one without, or ignoring the type parameters on DropDownChoice, as I always have in the past?
Regards, Matthew. On Mon, Feb 23, 2009 at 09:46, Matt Welch <[email protected]> wrote: > > > Martijn Dashorst wrote: > > > >> Just to make sure I'm understanding this; yuo're saying I have to create > >> a > >> variable and then assign the variable instead of just being able to pass > >> "new AllUsersModel()" to the DropDownChoice constructor? > > > > Nope, just change your model supertype from List<Foo> to List<? extends > > Foo> > > > >> That just seems.... odd. > > > > Welcome to Java generics... > > > Thanks. It's working now. > > > private class AllUsersModel extends LoadableDetachableModel<List<? > extends > User>>{ > protected List<User> load() { > return userService.findAllUsers(); > } > } > > -- > View this message in context: > http://www.nabble.com/LDM-with-Generics-for-DropDownChoice-tp22155211p22164005.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Matthew Rollins Hanlon http://squareoftwo.org _____________________ Hanlon's Razor: "Never attribute to malice that which can be adequately explained by stupidity." http://wikipedia.org/wiki/Hanlon's_razor
