Can I handle Error of any specific component using SetErrorHandler

I have following Code,

        selectAtm = new TextField();
        selectAtm.addValidator(new IntegerValidator("It should be Integer"));
        selectAtm.setErrorHandler(new ComponentErrorHandler() {

            public boolean handleComponentError(ComponentErrorEvent event) {
                getContext().getScreenObject().getWindow().showNotification("" + event.getThrowable());
                return true;

I want to set the Error handler , so that if any validation error is raised, error handler is called, but it is not working, is there any special way of using this ?