- 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 specificUICommand
orUIInput
has 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 boolean
isListenerForSource(Object source)
Only listens toUIInput
components which have aBeanValidator
assigned.void
processEvent(SystemEvent event)
Handle thePreValidateEvent
andPostValidateEvent
.
-
-
-
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 toUIInput
components which have aBeanValidator
assigned.- Specified by:
isListenerForSource
in interfaceSystemEventListener
-
processEvent
public void processEvent(SystemEvent event)
Handle thePreValidateEvent
andPostValidateEvent
.- Specified by:
processEvent
in interfaceSystemEventListener
-
-