Hi All,
I'm using wicket for a project at work, and for the most part, I'm really
enjoying it. Thanks to everyone involved.
I'm having some problems with choices, though.
I'm using a BoundCompoundPropertyModel in a Form. I have a DropDownChoice
that is driven by a List of USState objects.
DropDownChoice(id, Lsit of State Objects, new YourRenderer());
hope this helps
Cheers
Dipu
- Original Message -
From: David Ruberg [EMAIL PROTECTED]
To: wicket-user@lists.sourceforge.net
Sent: Friday, October 28, 2005 7:34 AM
Subject: [Wicket-user] DropDownChoice and RadioChoice
Hi All
this looks like the most commor error people are making with this.
I will try to see if i can check this earlier and really throw a better error.
The problem looks like that youre Selected object is not the same as youre List obect
It has to be of the same type!
what is returned from
On Fri, 28 Oct 2005 01:39:54 -0700, Johan Compagner [EMAIL PROTECTED]
wrote:
this looks like the most commor error people are making with this.
I will try to see if i can check this earlier and really throw a better
error.
The problem looks like that youre Selected object is not the same as
On Fri, 28 Oct 2005 01:22:39 -0700, Dipu [EMAIL PROTECTED] wrote:
I think you should have your own implementation of the choice renderer
for this, and should override the getDisplayValue method.
something like
public String getDisplayValue(Object object)
{
USState state = (USState
Perhaps I don't understand the intended usage here.
It seems like the type of thing I want to do must be fairly
common. Say I want to list US States by full name, but
persist the abbreviation (code) in my model. A map of
Strings in the front end (display, value) to a String in the
In my first post, I had a couple of issues, and I don't want to lose sightof the other, because it is actually a bigger problem.That is in the
case that I do just use a simple list of strings, like this:new DropDownChoice(id, LIST_OF_STRINGS);
if you do this then the model of the dropdown is
On Fri, 28 Oct 2005 10:03:53 -0700, Johan Compagner [EMAIL PROTECTED]
wrote:
snip
The id was not null!
Only when the selection is null and null is allowed Choose One is added.
This was the problem. I had changed the default from null to an empty
String in the model. That is why it
Most things i see use it as this:
Person
{
getCountry()
setCounter();
}
Country
{
getId()
setId();
getName()
setName();
}
new DropDownChoice(country, new Model(person), COUNTRY_LIST, new ChoiceRender(id, name))
johan
On 10/28/05, David Ruberg [EMAIL PROTECTED] wrote:
On Fri, 28 Oct 2005