public void invoke() {
// We can't unsubscribe immediately inside processEvent() itself, as it would otherwise end up in a
// ConcurrentModificationException while JSF is iterating over all system event listeners.
// The unsubscribe is necessary in order to avoid InstantiationException on this tag during restore
// view of a postback, because ComponentSystemEventListener instances are also saved in JSF view state.
component.unsubscribeFromEvent(PostValidateEvent.class, ViewParamValidationFailed.this);
}
});
if (component instanceof UIViewParameter ? ((UIViewParameter) component).isValid() : !context.isValidationFailed()) {
return; // Validation has not failed.