Re: DropDownChoices: How to force a selection.

2009-05-30 Thread Rob Sonke
It should work with the value in your model. In your case something like 
selectedDistrito.setSelectedChoice(1);


Rob

On 5/30/09 3:02 AM, Marco Santos wrote:

Here is the creation of the DDC:

private void buildDistritosComboBox() {
 DistritosModel distritosModel = new DistritosModel();
 SelectedChoice selectedDistrito = new SelectedChoice();//A class
with a variable selectedChoice and it getter and setter
 DropDownChoice distritosDDC = new DropDownChoice(distritos, new
PropertyModel(selectedDistrito, selectedChoice), distritosModel);
 distritosDDC.setOutputMarkupId(true);
 distritosDDC.setRequired(true);
   


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



DropDownChoices: How to force a selection.

2009-05-29 Thread Marco Santos
Hello There.
Im creating a page where the user can either create or update a registry. I
have a few DropDownChoices, and i am trying, on the case o updating a
registry, to set the a specific value of the choices of the dropdownchoice.
Does any one know how? I have tryed to set a value on the PropertyModel that
i use on the creation of the DDC.

Here is the creation of the DDC:

private void buildDistritosComboBox() {
DistritosModel distritosModel = new DistritosModel();
SelectedChoice selectedDistrito = new SelectedChoice();//A class
with a variable selectedChoice and it getter and setter
DropDownChoice distritosDDC = new DropDownChoice(distritos, new
PropertyModel(selectedDistrito, selectedChoice), distritosModel);
distritosDDC.setOutputMarkupId(true);
distritosDDC.setRequired(true);
}

Thanks a lot
-- 
Marco Santos