You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by lucast <lu...@hotmail.com> on 2012/01/30 11:26:29 UTC

Populate DropDownChoice, set Object Model and still keep "Please Select" option

Dear forum,
I'm dealing with a form in which I have a number of dropdown choices.
Some drop down choices will have value preselected (eg. second option on the
list). 

I would like the dropdown choices where the value is preselected to still
hold the "Please Select" option so that the user has the option to unselect
the value of the dropdown choice.

I tried using DropDownChoice.setNullValid(true); but that only works for the
dropdown choices in which no model has been set.

Thanks in advance,
Lucas


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Populate-DropDownChoice-set-Object-Model-and-still-keep-Please-Select-option-tp4340568p4340568.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


RE: Populate DropDownChoice, set Object Model and still keep "Please Select" option

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> I tried using DropDownChoice.setNullValid(true); but that only works for the
> dropdown choices in which no model has been set.

Then you probably also need setRequired(false); Otherwise it will not show the null choice for non-null models.

- Tor Iver

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