PrimeFaces Ajax Event

This attribute is used to trigger event on the specified method. We can pass onclick, keyup etc events in this attribute.

Default client side event for input component is onchange. We can override it by using event attribute. In following example, Ajax request is triggered when key is up on input field.

JSF File

// ajax-event.xhtml

Managed Bean

// User.java

Output:

PrimeFaces Event example 1

After entering value, Ajax event triggers and provides the following output:

PrimeFaces Event example 2