0

I have a session scoped CDI bean running in a JSF application.

@Named
@SessionScoped
public class myController implements Serializable {
 .....
}

I need to update the state of the bean in case a standard validation exception is thrown by the jsf framework. For example in case of a input field with required = true:

<h:inputText value="#{.....}" required="true" />

I did not find a way to trigger one of my bean methods in case a validateion exception is thrown. How can I do this?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Ralph
  • 4,500
  • 9
  • 48
  • 87
  • What is the actual use case for which you think 'triggering' a custom bean is what you need to do? I can think of several things that might solve this but it also might be that you are running into a http://xyproblem.info – Kukeltje May 29 '18 at 13:28
  • the bean collects data via ajax events. In case of a validation exception I need to display the current collected data. But the result need to be first updated and formated by the bean. – Ralph May 29 '18 at 14:26
  • Ok, I'm even more curious now to the more detailed usecase but I'd try to investigate the postValidationEvent that you can react on. See point 1 in the answer in https://stackoverflow.com/questions/23049930/performing-a-redirect-when-conversion-validation-associated-with-query-parame Although 3 might work too – Kukeltje May 29 '18 at 17:28

0 Answers0