- java.lang.Object
- 
- jakarta.faces.component.UIComponent
- 
- jakarta.faces.component.UIComponentBase
- 
- org.omnifaces.component.validator.ValidatorFamily
- 
- org.omnifaces.component.validator.ValidateMultipleFields
- 
- org.omnifaces.component.validator.ValidateAllOrNone
 
 
 
 
 
- 
- All Implemented Interfaces:
- PartialStateHolder,- StateHolder,- TransientStateHolder,- ComponentSystemEventListener,- FacesListener,- SystemEventListenerHolder,- EventListener,- MultiFieldValidator
 
 public class ValidateAllOrNone extends ValidateMultipleFields The <o:validateAllOrNone>validates if at least ALL of the givenUIInputcomponents have been filled out or that NONE of the givenUIInputcomponents have been filled out.The default message is {0}: Please fill out all or none of those fields For general usage instructions, refer ValidateMultipleFieldsdocumentation.- Author:
- Bauke Scholtz
- See Also:
- ValidateMultipleFields,- ValidatorFamily,- MultiFieldValidator
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCOMPONENT_TYPEThe component type, which is "org.omnifaces.component.validator.ValidateAllOrNone".- 
Fields inherited from class org.omnifaces.component.validator.ValidatorFamilyCOMPONENT_FAMILY
 - 
Fields inherited from class jakarta.faces.component.UIComponentATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY
 
- 
 - 
Constructor SummaryConstructors Constructor Description ValidateAllOrNone()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanshouldInvalidateInput(FacesContext context, UIInput input, Object value)In an invalidating case, invalidate only those inputs which have an empty value.booleanvalidateValues(FacesContext context, List<UIInput> inputs, List<Object> values)Validate if all or none is filled out.- 
Methods inherited from class org.omnifaces.component.validator.ValidateMultipleFieldscollectComponents, collectValues, getComponents, getMessage, getShowMessageFor, isDisabled, isInvalidateAll, isValidationFailed, setComponents, setDisabled, setInvalidateAll, setMessage, setShowMessageFor, showMessage, validateComponents, validateHierarchy
 - 
Methods inherited from class org.omnifaces.component.validator.ValidatorFamilyencodeChildren, getFamily, getRendersChildren, processDecodes, processUpdates, processValidators
 - 
Methods inherited from class jakarta.faces.component.UIComponentBaseaddClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
 - 
Methods inherited from class jakarta.faces.component.UIComponentencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree
 
- 
 
- 
- 
- 
Field Detail- 
COMPONENT_TYPEpublic static final String COMPONENT_TYPE The component type, which is "org.omnifaces.component.validator.ValidateAllOrNone".- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
validateValuespublic boolean validateValues(FacesContext context, List<UIInput> inputs, List<Object> values) Validate if all or none is filled out.- Parameters:
- context- The faces context to work with.
- inputs- The input components whose values are to be validated.
- values- The values of the input components to be validated, in the same order as the components.
- Returns:
- trueif validation is successful, otherwise- false(and thus show the message).
 
 - 
shouldInvalidateInputprotected boolean shouldInvalidateInput(FacesContext context, UIInput input, Object value) In an invalidating case, invalidate only those inputs which have an empty value.- Overrides:
- shouldInvalidateInputin class- ValidateMultipleFields
- Parameters:
- context- The faces context to work with.
- input- The input component which may need to be invalidated.
- value- The value of the input component.
- Returns:
- Whether in in an invalidating case the given input component should be marked invalid
 
 
- 
 
-