
Uwe Schaefer

Friday, 26th of December 2008 at 12:00:00 AM
This one is all about id <-> object mapping when using DropDowns:
|
/** |
* @author igor vaynberg |
*/ |
public class DropDownIdChoice extends DropDownChoice |
{ |
|
public DropDownIdChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer, Class<?> type) |
{ |
super(id, model, choices, renderer); |
setType(type); |
} |
|
@Override |
public String getModelValue() |
{ |
final Object id = getModelObject(); |
if (id != null) |
{ |
return getConverter(getType()).convertToString(id, getLocale()); |
} |
else |
{ |
return NO_SELECTION_VALUE; |
} |
} |
} |