Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of JSF 2 events?

So far I have only known and seen

<f:event type="preRenderView" listener="#{situationHelper.load}"/>

and I wonder where I can find a list of other page (or view) events other than preRenderView?

Particularly, I'm looking for a event which is triggered before the binding proccess, (preRenderView runs after components are bound)

Thanks.

like image 237
hirikarate Avatar asked Nov 18 '11 03:11

hirikarate


People also ask

What is event handling in JSF?

Advertisements. When a user clicks a JSF button or link or changes any value in the text field, JSF UI component fires an event, which will be handled by the application code. To handle such an event, an event handler is to be registered in the application code or managed bean.


1 Answers

From the tag library document of JSF 2.1

Name of the event for which to install a listener. The following table lists the valid values for this attribute, and the corresponding event type for which the listener action is registered.

value for "type" tag attribute        Type of event sent to listener method
preRenderComponent                    javax.faces.event.PreRenderComponentEvent
preRenderView                         javax.faces.event.PreRenderViewEvent 
postAddToView                         javax.faces.event.PostAddToViewEvent 
preValidate                           javax.faces.event.PreValidateEvent 
postValidate                          javax.faces.event.PostValidateEvent

In addition to these values, the fully qualified class name of any java class that extends javax.faces.event.ComponentSystemEvent may be used as the value of the "type" attribute.

So , beside the values listed above , you can also use the fully qualified class name of direct known subclasses of javax.faces.event.ComponentSystemEvent for the type tag attribute , which can be found in the Java docs .

like image 138
Ken Chan Avatar answered Oct 11 '22 18:10

Ken Chan