@Override
 public Object getConvertedValue(
     FacesContext context, UIComponent component, Object submittedValue)
     throws ConverterException {
   Renderer renderer =
       ComponentUtils.getUnwrappedRenderer(
           context, "javax.faces.SelectOne", "javax.faces.Listbox", Renderer.class);
   return renderer.getConvertedValue(context, component, submittedValue);
 }
Пример #2
0
 public static Object getConvertedValue(
     final FacesContext context, final UIInput component, final Object submittedValue) {
   try {
     final Renderer renderer = getRenderer(context, component);
     if (renderer != null) {
       return renderer.getConvertedValue(context, component, submittedValue);
     } else if (submittedValue instanceof String) {
       return getConvertedUIOutputValue(context, component, submittedValue);
     }
   } catch (final ConverterException e) {
     final FacesMessage facesMessage = e.getFacesMessage();
     if (facesMessage != null) {
       context.addMessage(component.getClientId(context), facesMessage);
     } else {
       final Object[] args = new Object[] {UIComponentUtil.getLabel(component)};
       context.addMessage(
           component.getClientId(context),
           FacesMessageUtil.getMessage(context, UIInput.CONVERSION_MESSAGE_ID, args));
     }
     component.setValid(false);
   }
   return submittedValue;
 }