code: public static Object getValueToRender(FacesContext context, UIComponent component) {
  		if (component instanceof ValueHolder) {
  
  			if (component instanceof EditableValueHolder) {
  				EditableValueHolder input = (EditableValueHolder) component;
  				Object submittedValue = input.getSubmittedValue();
  
  				if (submittedValue == null && context.isValidationFailed() && !input.isValid()) {
  					return null;
  				} else if (submittedValue != null) {
  					return submittedValue;
  				}
  			}
  
  			ValueHolder valueHolder = (ValueHolder) component;
  			Object value = valueHolder.getValue();
  			return value;
  		}
  
  		// component it not a value holder
  		return null;
  	}
docs: This method has been copied from the PrimeFaces 5 project (and been
  adapted after).
  
  Algorithm works as follows; - If it's an input component, submitted value
  is checked first since it'd be the value to be used in case validation
  errors terminates jsf lifecycle - Finally the value of the component is
  retrieved from backing bean and if there's a converter, converted value
  is returned
  
  @param context
  FacesContext instance
  @param component
  UIComponent instance whose value will be returned
  @return End text