View RSS Feed


JSF Events Handling

Rate this Entry
, 01-02-2012 at 07:48 PM (1291 Views)
JSF components trigger events and these events are process by the JSF application. User generates these events by interacting with the application. For example, Click a button event is generated and triggered by the user. Programmer is responsible to handle all such events in code. You can write event listeners for this purpose.

Following JSF code is written to create a button.

Java Code: This is example of a JSF Button
<h:commandButton value="Login“
action=“#{customer.login}” />
An event listener is written in the Customer class as follows:

Java Code: JSF Event listener
class Customer { 
public void loginActionListener(ActionEvent e) {
public String login() {
return “OK”;

Submit "JSF Events Handling" to Facebook Submit "JSF Events Handling" to Digg Submit "JSF Events Handling" to Submit "JSF Events Handling" to StumbleUpon Submit "JSF Events Handling" to Google

Updated 01-14-2012 at 07:28 PM by JSF