You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Matthew Welch <ma...@welchkin.net> on 2010/07/07 22:55:09 UTC

Add "Any" option to DropDownChoice

I'm sure this has been answered before but I've a good bit searching the
list and can't seem to find it...

I need to add an option to a DropDownChoice that displays the word "Any" and
will be treated differently than the other options. I've hacked an
IChoiceRenderer to death and managed to get the option to display but
obviously when the form is submitted and Wicket tries to update the model
things fall apart. I'm clearly doing things wrong at a very basic level

This doesn't seem like isn't an unusual use case so I assume I'm probably
missing something obvious, but I could sure use some help seeing it.

Re: Add "Any" option to DropDownChoice

Posted by Sven Meier <sv...@meiers.net>.
Actually it works without a "null" in your choices.

Sven
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Add-Any-option-to-DropDownChoice-tp2281498p2281887.html
Sent from the Wicket - User 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: Add "Any" option to DropDownChoice

Posted by Igor Vaynberg <ig...@gmail.com>.
you need to have an actual value in the choices collection that
represents the "any" option. you can do this by prepending "null" to
your choices collection, letting the renderer render it as "any" and
calling setnullvalid(true) on the ddc.

-igor

On Wed, Jul 7, 2010 at 1:55 PM, Matthew Welch <ma...@welchkin.net> wrote:
> I'm sure this has been answered before but I've a good bit searching the
> list and can't seem to find it...
>
> I need to add an option to a DropDownChoice that displays the word "Any" and
> will be treated differently than the other options. I've hacked an
> IChoiceRenderer to death and managed to get the option to display but
> obviously when the form is submitted and Wicket tries to update the model
> things fall apart. I'm clearly doing things wrong at a very basic level
>
> This doesn't seem like isn't an unusual use case so I assume I'm probably
> missing something obvious, but I could sure use some help seeing it.
>

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