Re: DropDownChoice with Model for data and HashMap of key/values

2008-12-15 Thread Steve Swinsburg
After a fresh start on a Monday, I figured out how to use a Hashmap in a DropDownChoice component when separate id/display values are required. I was hoping to get a bit more of an explicit answer from the community on this one though, since I was completely stumped, which is what I

Re: DropDownChoice with Model for data and HashMap of key/values

2008-12-15 Thread Igor Vaynberg
On Mon, Dec 15, 2008 at 6:02 AM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: After a fresh start on a Monday, I figured out how to use a Hashmap in a DropDownChoice component when separate id/display values are required. I was hoping to get a bit more of an explicit answer from the

Re: DropDownChoice with Model for data and HashMap of key/values

2008-12-12 Thread Igor Vaynberg
new ichoicerendererinteger() { Object getDisplayValue(integer object) { return choices.get((integer)object); } String getIdValue(integer object, int index) { return object.tostring(); } } -igor On Fri, Dec 12, 2008 at 9:46 AM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: Hi all,

Re: DropDownChoice with Model for data and HashMap of key/values

2008-12-12 Thread Steve Swinsburg
Thanks. I now have this: IModel dropDownModel = new Model() { protected Object load() { preferences.put(0, some choice); preferences.put(1, some other choice); preferences.put(2,

Re: DropDownChoice with Model for data and HashMap of key/values

2008-12-12 Thread Igor Vaynberg
that map needs to be in the choicerenderer. your domain model type is integer, ddcinteger looks like this: dropdownchoice(string id, imodelinteger model, imodellistinteger choices, ichoicerendererinteger renderer) -igor On Fri, Dec 12, 2008 at 10:36 AM, Steve Swinsburg