Example usage for com.vaadin.ui AbstractComponent markAsDirty

List of usage examples for com.vaadin.ui AbstractComponent markAsDirty

Introduction

In this page you can find the example usage for com.vaadin.ui AbstractComponent markAsDirty.

Prototype

@Override
    public void markAsDirty() 

Source Link

Usage

From source file:com.haulmont.cuba.web.exception.InvalidValueExceptionHandler.java

License:Apache License

@Override
public boolean handle(ErrorEvent event, App app) {
    boolean handled = super.handle(event, app);

    //noinspection ThrowableResultOfMethodCallIgnored
    if (handled && event.getThrowable() != null) {
        // Finds the original source of the error/exception
        AbstractComponent component = DefaultErrorHandler.findAbstractComponent(event);
        if (component != null) {
            component.markAsDirty();
        }//  ww  w .j  a  v  a2  s .com

        if (component instanceof Component.Focusable) {
            ((Component.Focusable) component).focus();
        }

        //noinspection ThrowableResultOfMethodCallIgnored
        if (event.getThrowable() instanceof Validator.InvalidValueException) {
            app.getAppUI().discardAccumulatedEvents();
        }
    }
    return handled;
}