@ Override protected void validateComponent ( final List < Diagnostic > diags ) { // Mandatory validation if ( isMandatory ( ) && isEmpty ( ) ) { diags . add ( createMandatoryDiagnostic ( ) ) ; } // Other validations List < FieldValidator > validators = getComponentModel ( ) . validators ; if ( validators != null ) { for ( FieldValidator validator : validators ) { validator . validate ( diags ) ; } } }
Override WComponent s validatorComponent in order to use the validators which have been added to this input field . Subclasses may still override this method but it is suggested to call super . validateComponent to ensure that the validators are still used .