Nov 8, 2018

How to react to action events or value-change events in JSF

There are two ways to cause your application to react to action events or value-change events that are emitted by a standard component in JSF:
  • Implement an event listener class to handle the event and register the listener on the component by nesting either an f:valueChangeListener tag or an f:actionListener tag inside the component tag.
  • Implement a method of a managed bean to handle the event and refer to the method with a method expression from the appropriate attribute of the component's tag.