java.lang.Object
org.omnifaces.eventlistener.BeanValidationEventListener
- All Implemented Interfaces:
FacesListener,SystemEventListener,EventListener
Overrides
BeanValidator.setValidationGroups(String) for all components in the current view. This allows to temporarily use different validationGroups
or disabling validation if a specific UICommand or UIInput has invoked the form submit.- Since:
- 1.3
- Author:
- Adrian Gygax, Bauke Scholtz
-
Constructor Summary
ConstructorsConstructorDescriptionBeanValidationEventListener(String validationGroups, boolean disabled) Construct an instance of bean validation event listener based on the given validation groups and disabled state. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisListenerForSource(Object source) Only listens toUIInputcomponents which have aBeanValidatorassigned.voidprocessEvent(SystemEvent event) Handle thePreValidateEventandPostValidateEvent.
-
Constructor Details
-
BeanValidationEventListener
Construct an instance of bean validation event listener based on the given validation groups and disabled state.- Parameters:
validationGroups- The validation groups.disabled- The disabled state.
-
-
Method Details
-
isListenerForSource
Only listens toUIInputcomponents which have aBeanValidatorassigned.- Specified by:
isListenerForSourcein interfaceSystemEventListener
-
processEvent
Handle thePreValidateEventandPostValidateEvent.- Specified by:
processEventin interfaceSystemEventListener
-