List of usage examples for com.vaadin.v7.data.util.converter ConverterUtil convertToModel
public static <MODELTYPE, PRESENTATIONTYPE> MODELTYPE convertToModel(PRESENTATIONTYPE presentationValue, Class<MODELTYPE> modelType, Converter<PRESENTATIONTYPE, MODELTYPE> converter, Locale locale) throws Converter.ConversionException
From source file:org.vaadin.viritin.v7.fields.MTextField.java
License:Apache License
protected void doEagerValidation() { final boolean wasvalid = eagerValidationStatus; eagerValidationStatus = true;//from w w w . ja va 2 s. c o m eagerValidationError = null; try { if (isRequired() && getLastKnownTextContent().isEmpty()) { throw new Validator.EmptyValueException(getRequiredError()); } validate(getLastKnownTextContent()); if (!wasvalid) { markAsDirty(); } // Also eagerly pass content to backing bean to make top level // validation eager, but do not listen the value back in value change // event if (getPropertyDataSource() != null) { skipValueChangeEvent = true; Object convertedValue = ConverterUtil.convertToModel(getLastKnownTextContent(), getPropertyDataSource().getType(), getConverter(), getLocale()); getPropertyDataSource().setValue(convertedValue); skipValueChangeEvent = false; } } catch (Validator.InvalidValueException e) { eagerValidationError = e; eagerValidationStatus = false; markAsDirty(); } }