Re: DropDownChoice ID's

2009-05-11 Thread Oblivian
I was missing the fact the values are looked up. Your right, I do not care if the values are 1,2,3... as long as I get the right stuff in my Model John Krasnay wrote: > > Why do you care what the id's are? Wicket doesn't store the ID anywhere, > it just uses the ID to look up the list element

Re: DropDownChoice ID's

2009-05-10 Thread John Krasnay
Why do you care what the id's are? Wicket doesn't store the ID anywhere, it just uses the ID to look up the list element to put into the model. jk On Sun, May 10, 2009 at 08:08:30AM -0700, Oblivian wrote: > > After changing genders from List to List, I'm seeing the > opposite behaviour. The val

Re: DropDownChoice ID's

2009-05-10 Thread Oblivian
After changing genders from List to List, I'm seeing the opposite behaviour. The values are coming across as ['m','f'] but the id's are ['0','1'] Overriding getIdValues() instead of getDisplayValues() seems to work. John Krasnay wrote: > > The golden rule of DropDownChoice is that the values

Re: DropDownChoice ID's

2009-05-10 Thread John Krasnay
The golden rule of DropDownChoice is that the values in the list must be the same as the property you are trying to set. In your case, if you want basicDemographicInfo.gender to be set to "m" or "f", you must pass the DropDownChoice the list [ "m", "f" ]. You'll then need a renderer that produces t

Re: DropDownChoice ID's

2009-05-09 Thread Igor Vaynberg
this should clear things up for you http://www.systemmobile.com/?page_id=236 -igor On Sat, May 9, 2009 at 7:26 PM, Oblivian wrote: > > basicDemographicInfo.gender is a String > and > genders is List > > > John Krasnay wrote: >> >> What is the type of the "gender" property of BasicDemographicInf

Re: DropDownChoice ID's

2009-05-09 Thread Oblivian
basicDemographicInfo.gender is a String and genders is List John Krasnay wrote: > > What is the type of the "gender" property of BasicDemographicInfo? > > jk > > On Sat, May 09, 2009 at 12:39:58PM -0700, Oblivian wrote: >> >> Not sure what I'm doing wrong. I need a DropDownChoice with ...

Re: DropDownChoice ID's

2009-05-09 Thread Oblivian
basicDemographicInfo.gender is a String and genders is List Oblivian wrote: > > List test = Arrays.asList(new String[] { "A", "B", "C" }); > add(new DropDownChoice("test", test)); > > How can I make the Id's match the Values? There coming through as > 1,2,3. I've tried custom ChoiceRen

Re: DropDownChoice ID's

2009-05-09 Thread Oblivian
basicDemographicInfo.gender is a String and genders is List John Krasnay wrote: > > What is the type of the "gender" property of BasicDemographicInfo? > > jk > > On Sat, May 09, 2009 at 12:39:58PM -0700, Oblivian wrote: >> >> Not sure what I'm doing wrong. I need a DropDownChoice with ..

Re: DropDownChoice ID's

2009-05-09 Thread John Krasnay
What is the type of the "gender" property of BasicDemographicInfo? jk On Sat, May 09, 2009 at 12:39:58PM -0700, Oblivian wrote: > > Not sure what I'm doing wrong. I need a DropDownChoice with ... > > Female > Male > > have a basic class like this ... > > public class Gender implements Seria

Re: DropDownChoice ID's

2009-05-09 Thread Oblivian
Not sure what I'm doing wrong. I need a DropDownChoice with ... Female Male have a basic class like this ... public class Gender implements Serializable { String id; String name; public Gender(); public Gender(String id, String name); public String getI

Re: DropDownChoice ID's

2009-05-08 Thread Oblivian
Thanks. Oblivian wrote: > > List test = Arrays.asList(new String[] { "A", "B", "C" }); > add(new DropDownChoice("test", test)); > > How can I make the Id's match the Values? There coming through as > 1,2,3. I've tried custom ChoiceRenderer, but seem to be missing > something. > > Any hel

Re: DropDownChoice ID's

2009-05-08 Thread Oblivian
Think I figured it out by doing something like this. Is this the right way? public class StringChoiceRender implements IChoiceRenderer { public Object getDisplayValue(Object object) { return object.toString(); } public String getIdValue(Object object, int index) { return object

Re: DropDownChoice ID's

2009-05-08 Thread Igor Vaynberg
new ichoicerenderer { object getid(string object, int index) { return object; } string getdisplayvalue(string object) { return object; } } -igor On Fri, May 8, 2009 at 2:19 PM, Chris wrote: > List test = Arrays.asList(new String[] { "A", "B", "C" }); > add(new DropDownChoice("test", test));

DropDownChoice ID's

2009-05-08 Thread Chris
List test = Arrays.asList(new String[] { "A", "B", "C" }); add(new DropDownChoice("test", test)); How can I make the Id's match the Values? There coming through as 1,2,3. I've tried custom ChoiceRenderer, but seem to be missing something. Any help is appreciated. ---