private static final long serialVersionUID = 1L;
@Override
public IConverter getConverter(Class<?> type)
{
IConverter c = AjaxEditableChoiceLabel.this.getConverter(type);
return c != null ? c : super.getConverter(type);
}
@SuppressWarnings("unchecked")
@Override
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
{
String displayValue = getDefaultModelObjectAsString();
if (renderer != null)
{
Object displayObject = renderer.getDisplayValue((T)getDefaultModelObject());
Class<?> objectClass = (displayObject == null ? null : displayObject.getClass());
if ((objectClass != null) && (objectClass != String.class))
{
final IConverter converter = getConverter(objectClass);
displayValue = converter.convertToString(displayObject, getLocale());
}
else if (displayObject != null)
{
displayValue = displayObject.toString();
}