http://cwiki.apache.org/WICKET/dropdownchoice.html
Hoover, William wrote:
Can you add this to the wiki
(http://cwiki.apache.org/WICKET/dropdownchoice-examples.html)? It seems like
a commonly asked question :o)
-
To
DropDownChoice has a lot of contructors. One of them,
DropDownChoice(String id, IModel model, IModel choices, ...)
The first model, could be named selectedModel. And represents the selected
object, with a wicket model.
Funny, I answered the same question to my colleague this morning.
Below the code I gave him.
What happens is that the model is wrapped in another model. The wrapping
model has a defaultModel that is used to return a value when the
underlying model returns null.
Below the model wrapper you find
to pre-select a DropDownChoice
Funny, I answered the same question to my colleague this morning.
Below the code I gave him.
What happens is that the model is wrapped in another model. The wrapping
model has a defaultModel that is used to return a value when the
underlying model returns null.
Below
Yeah, I figured that out last night. That's actually a great way of
handling the component's state. Thanks for your input.
-Original Message-
From: Nick Heudecker [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2008 5:57 PM
To: users@wicket.apache.org
Subject: Re: How to pre-select
Set the model of the DDC to the value you want to have selected.
On Thu, Mar 13, 2008 at 7:53 PM, Michael Mehrle [EMAIL PROTECTED]
wrote:
I feel silly asking this, but I can't figure it out. I need to set my
DropDownChoice component to the id I'm passing into my page via a
pageparam. How do I