View RSS Feed

JSF

JSF Event Classes

Rate this Entry
by
JSF
, 07-07-2012 at 04:52 PM (564 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.

Java Code:
UIComponent someComponent = new UIComponent();
MyFacesEvent event = new MyFacesEvent(someComponent);
UIComponent sourceCompoenent = event.getComponent();
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:
MyFacesEvent event = new MyFacesEvent();
event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);

Submit "JSF Event Classes" to Facebook Submit "JSF Event Classes" to Digg Submit "JSF Event Classes" to del.icio.us Submit "JSF Event Classes" to StumbleUpon Submit "JSF Event Classes" to Google

Categories
Event

Comments