Hi All,
I am using MVP(Model View Presenter) pattern in my application. I am doing custom validation for Custom Form which uses FieldFactory.
public MeasurementResultForm() {
setImmediate(true);
setFormFieldFactory(new MeasurementsResultsFormFieldFactory());
setValidationVisible(true);
setComponentError(null);
setMeasurementForm(); // where am setting ItemDataSource
}
I am using Custom validation under ValueChangeEvent in Presenter for some fields in the above form.
public void valueChange(ValueChangeEvent event) {
// on validation
form.setComponentError(CustomErrorMessage);
}
Anyhow am successfully displayed error message in the space for component error with error indicator label but am fail to display error indicators in the fields where validation failed.
I have tried by calling
form.commit()
under valueChangeEvent() but no luck in displaying error indicator. Any help is highly appreciated and thanks in advance.