You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "micah.k.willard" <mi...@gmail.com> on 2014/11/13 23:09:33 UTC

Re: Dropdownchoice without default option "choose one"

I noticed this thread never had a very conclusive answer, so I hope you don't
mind if I resurrect it.

nitinkc, where are you setting this at? Does it happen to be in the DDC
onInit method? I ask, because I have noticed that when it is placed there,
it is ignored. Instead I assign the DDC to a var and then do
"var.setNullValid(false);", before adding it. This removes the null value
for me every time.


nitinkc wrote
> I tried setNullValid(false). But this does not get rid of the "choose one"
> option. Note that the choices are a list of Strings. If the choices are a
> list of other user defined object types and I use a choicerendrer for
> display values, the "choose one" option is removed(without
> setNullValid(false)). Any ideas?
> Michael O'Cleirigh wrote
>> Hi nitinkc,
>> 
>> Calling setNullValid (false) on the drop down choice should get rid of 
>> the default "choose one" text.
>> 
>> If the ddc model should always have a value defined then you could set 
>> the model object to be for example the first choice.
>> 
>> e.g. ddc.setModelObject (ddc.getChoices().get(0));
>> 
>> Regards,
>> 
>> Mike
>> 
>>> I would like to remove the default "choose one" option from the
>>> DropDownChoice component.
>>> Does anyone know how to do this. Thanks.
>>>   
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dropdownchoice-without-default-option-choose-one-tp1866175p4668398.html
Sent from the Users forum mailing list archive at Nabble.com.

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