Re: [Wicket-user] DropDownChoice binding question

2006-12-31 Thread Flavius
ok, I see where you're going with this. very cool. My enum is in a helper class and I started writing conversion methods in the helper class. But I like the way you wrapped your conversion methods in a class to use on the Page class. I also gave some thought last night to using a MapInteger,

[Wicket-user] DropDownChoice binding question

2006-12-30 Thread Flavius
Greetings, I am trying to take the value (only) of a DropDownChoice and put it in a model set on the Form. Ideally, I'd like to use a (java 5) enum, but any type of name value pair will work. For example, if I'm trying to set the size of a Shirt class, here is my Shirt, and a sample enum:

Re: [Wicket-user] DropDownChoice binding question

2006-12-30 Thread Nick Heudecker
IChoiceRenderer allows you to specify the id and display values for a DropDownChoice. It's exactly what you're looking for. To explain a bit: getDisplayValue(...) - returns the value you want the user to see. Small, Medium, etc. This is where you'd return SIZE.getName(). getIdValue(...)

Re: [Wicket-user] DropDownChoice binding question

2006-12-30 Thread Flavius
I tried this: DropDownChoice severityChoice = new DropDownChoice(size, Arrays.asList(SIZE.values()), new ChoiceRenderer() { public Object

Re: [Wicket-user] DropDownChoice binding question

2006-12-30 Thread Nick Heudecker
Can I see a bit more of your code? What you've posted looks good, so it's possible something else is causing the problem. You could try ##wicket on Freenode for more help. On 12/30/06, Flavius [EMAIL PROTECTED] wrote: I tried this: DropDownChoice severityChoice =

Re: [Wicket-user] DropDownChoice binding question

2006-12-30 Thread Igor Vaynberg
you are passing a list of enum objects into the list model of the dropdown choice, that means the one selected object out of that list - of type enum - will be set into the model object. so there are two ways to do this you can pass in a list of ints into the choice component, that way the

Re: [Wicket-user] DropDownChoice binding question

2006-12-30 Thread Jonathan Locke
not sure what's wrong with your code, but i've done enum selection in voicetribe with code that looks like the following: add(new DropDownChoice(genre, new Model() { @Override public Object getObject(Component component) {