Re: Add a choice to a DropDownChoice
Argh sorry for the quick answer.. Instead of using a list to supply options for the dropdown you'll need to use a model, and then add the option by adding it to the modelobject.. This is how I've done it. Afterwards you can either poke model.changed or model.setobject with the list. regards Nino Nino Saturnino Martinez Vazquez Wael wrote: Sure just add it to the model/bean:) andrea pantaleoni wrote: Hi, I'm creating a DropDownChoice in this way: DropDownChoice dropDownChoice = new DropDownChoice(id,PropertyModel(beanName,propertyName),List,renderer) Now I want to add a choice with key 0 and Value (empty string) I was looking for the API and I expected to find something like dropDownChoice.addChoice(choice) but there is not. Is there a way to add a extra choice after the dropdown component is built? Many thanks Andrea - 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]
Re: Add a choice to a DropDownChoice
Sure just add it to the model/bean:) andrea pantaleoni wrote: Hi, I'm creating a DropDownChoice in this way: DropDownChoice dropDownChoice = new DropDownChoice(id,PropertyModel(beanName,propertyName),List,renderer) Now I want to add a choice with key 0 and Value (empty string) I was looking for the API and I expected to find something like dropDownChoice.addChoice(choice) but there is not. Is there a way to add a extra choice after the dropdown component is built? Many thanks Andrea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Add a choice to a DropDownChoice
Hi, I'm creating a DropDownChoice in this way: DropDownChoice dropDownChoice = new DropDownChoice(id,PropertyModel(beanName,propertyName),List,renderer) Now I want to add a choice with key 0 and Value (empty string) I was looking for the API and I expected to find something like dropDownChoice.addChoice(choice) but there is not. Is there a way to add a extra choice after the dropdown component is built? Many thanks Andrea -- View this message in context: http://www.nabble.com/Add-a-choice-to-a-DropDownChoice-tf4322067.html#a12307733 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Add a choice to a DropDownChoice
class mypanel extends panel { private List options; mypanel () { add(new dropdownchoice(id,model, new PropertyModel(this, options),...);} now that it is using a property model to retrieve its choices just add/remove items from the options list -igor On 8/24/07, andrea pantaleoni [EMAIL PROTECTED] wrote: Hi, I'm creating a DropDownChoice in this way: DropDownChoice dropDownChoice = new DropDownChoice(id,PropertyModel(beanName,propertyName),List,renderer) Now I want to add a choice with key 0 and Value (empty string) I was looking for the API and I expected to find something like dropDownChoice.addChoice(choice) but there is not. Is there a way to add a extra choice after the dropdown component is built? Many thanks Andrea -- View this message in context: http://www.nabble.com/Add-a-choice-to-a-DropDownChoice-tf4322067.html#a12307733 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]