FacesContext context,
UIComponent component,
ReturnEvent event)
{
Object returnValue = event.getReturnValue();
GenericConverterFactory fac = GenericConverterFactory.getCurrentInstance();
// If we got passed a Date object, send it back to String
// land (where it needs to be for submitted values).
if ((returnValue instanceof Date) || fac.isConvertible(returnValue, Date.class))
{
FacesBean bean = getFacesBean(component);
Converter converter = getConverter(component, bean);
if (converter == null)
converter = getDefaultConverter(context, component, bean);