The DDC will reflect whatever is in its model (the model for the selected value, not the one for the list of items to choose from). So, just set your model.
On Wed, Feb 9, 2011 at 10:52 PM, Niv <[email protected]> wrote: > > Hi > Is there a way I can have the selected option on a DropDownChoice to be set > with one of the items in the Model instead of ' Choose One' as the > selected item by default? I know this has been asked around in a different > sense but I could not find a closer match to this. > Code Snippet > > List<Country> countryList =service.getCountries(); > ChoiceRenderer<Country> defaultChoiceRenderer = new > ChoiceRenderer<Country>(Constants.NAME, Constants.ID); > countryChoice = new DropDownChoice<Country>(Constants.ADDRESS_COUNTRY, > countryList, defaultChoiceRenderer); > > //Would like the countryChoice to be able to have the First Contry in the > countrList to be the one rendered instead of 'Choose One'. > > Thanks and if it seems redundant do pardon me > Cheers > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-Choose-One-Selected-Item-tp3298535p3298535.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > 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]
