Exemplo n.º 1
0
  @Override
  public Object getConvertedValue(
      FacesContext context, UIComponent component, Object submittedValue)
      throws ConverterException {
    Converter converter = ComponentUtils.getConverter(context, component);

    if (converter != null) {
      String convertableValue = submittedValue == null ? null : submittedValue.toString();
      return converter.getAsObject(context, component, convertableValue);
    } else {
      return submittedValue;
    }
  }
Exemplo n.º 2
0
  @Override
  public Object getConvertedValue(
      FacesContext context, UIComponent component, Object submittedValue)
      throws ConverterException {
    Editor editor = (Editor) component;
    String value = (String) submittedValue;
    Converter converter = ComponentUtils.getConverter(context, component);

    if (converter != null) {
      return converter.getAsObject(context, editor, value);
    }

    return value;
  }