On Thu, 05 Apr 2007, Toscano wrote: > The getCountries() method outputs the list of countries depending on the > language stored in session. > But if I create the DropDownChoice as you said: > > countries = new DropDownChoice("country", > new Model() { > public List getObject() > { > return getCountries();} > }, new ChoiceRenderer ("countryName", "countryID")); > > I have a RunTimeException: java.lang.NullPointerException: List of choices > is null - Was the supplied 'Choices' model empty?
As far as I remember, at least in 2.0 DropDownChoice takes in two models: a list of the choices, and the initial choice. (By the way, this is an excellent example of where generics make the constructor more explicit). So double-check that you are supplying the choices correctly, and not in fact invoking a constructor that only determines the default choice. -- Timo Rantalaiho Reaktor Innovations Oy <URL: http://www.ri.fi/ > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user