Interface ValidationCallbackMixin
- All Known Implementing Classes:
FileListComponent, MultiFileComponent, SingleFileComponent
public interface ValidationCallbackMixin
Mixin for classes extending
UIComponent that implements processValidators(context) by first validating the component itself, then processing its children.
To use this mixin, you need to override validateSelf(FacesContext) and provide your validation logic for
the component. In addition, you also need to override UIComponent.processValidators(FacesContext) to point to
the implementation provided by this mixin, e.g.:
@Override
public void processValidators(FacesContext context) {
ValidationCallbackMixin.super.processValidators(context);
}
This mixin assumes that any class using this mixin is a subclass of UIComponent.
- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidprocessValidators(javax.faces.context.FacesContext context) booleanvalidateSelf(javax.faces.context.FacesContext context) Validates the component (and not its children), returning whether it is valid or not.
-
Method Details
-
processValidators
default void processValidators(javax.faces.context.FacesContext context) -
validateSelf
boolean validateSelf(javax.faces.context.FacesContext context) Validates the component (and not its children), returning whether it is valid or not. You can add Faces messages within this method if validation fails.- Parameters:
context- The current Faces context.- Returns:
- True if this component is valid, false otherwise.
-