Package org.omnifaces.eventlistener
Class BeanValidationEventListener
- java.lang.Object
-
- org.omnifaces.eventlistener.BeanValidationEventListener
-
- All Implemented Interfaces:
FacesListener,SystemEventListener,EventListener
public class BeanValidationEventListener extends Object implements SystemEventListener
OverridesBeanValidator.setValidationGroups(String)for all components in the current view. This allows to temporarily use different validationGroups or disabling validation if a specificUICommandorUIInputhas invoked the form submit.- Since:
- 1.3
- Author:
- Adrian Gygax, Bauke Scholtz
-
-
Constructor Summary
Constructors Constructor Description BeanValidationEventListener(String validationGroups, boolean disabled)Construct an instance of bean validation event listener based on the given validation groups and disabled state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisListenerForSource(Object source)Only listens toUIInputcomponents which have aBeanValidatorassigned.voidprocessEvent(SystemEvent event)Handle thePreValidateEventandPostValidateEvent.
-
-
-
Constructor Detail
-
BeanValidationEventListener
public BeanValidationEventListener(String validationGroups, boolean disabled)
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 Detail
-
isListenerForSource
public boolean isListenerForSource(Object source)
Only listens toUIInputcomponents which have aBeanValidatorassigned.- Specified by:
isListenerForSourcein interfaceSystemEventListener
-
processEvent
public void processEvent(SystemEvent event)
Handle thePreValidateEventandPostValidateEvent.- Specified by:
processEventin interfaceSystemEventListener
-
-