JSF Event Classes
by, 07-07-2012 at 05:52 PM (412 Views)
Interfaces which are related with JSF events are present in package'javax.faces.event'. All Events present in JSF shall be extending the javax.faces.event.FacesEvent. This class’s constructor has argument UIComponent that would be making it specific that this Event is for which UI component.
In the code given above, particular event that has been created by the source component could be obtained when event.getComponent() is called. Method known as queue() is present in this class that queues the Event when request processing life cycle ends. When it is required to queue the Event and takes place at specific processing phase of the request, it could be done when this given code is being followed:Java Code:UIComponent someComponent = new UIComponent(); MyFacesEvent event = new MyFacesEvent(someComponent); UIComponent sourceCompoenent = event.getComponent();
Java Code:MyFacesEvent event = new MyFacesEvent(); event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);