Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <code>event</code> attribute of <code>&lt;f:ajax&gt;</code> can hold <em>at least</em> all supported <a href="http://en.wikipedia.org/wiki/DOM_events">DOM events</a> of the HTML element which is been generated by the JSF component in question. An easy way to find them all out is to check all <code>on*</code> attribues of the JSF input component of interest in the <a href="https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/">JSF tag library documentation</a> and then remove the "on" prefix. For example, <a href="https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/h/inputText.html">the <code>&lt;h:inputText&gt;</code> component</a> which renders <code>&lt;input type="text"&gt;</code> lists the following <code>on*</code> attributes (of which I've already removed the "on" prefix so that it ultimately becomes the DOM event type name):</p> <ul> <li><code>blur</code></li> <li><code>change</code></li> <li><code>click</code></li> <li><code>dblclick</code></li> <li><code>focus</code></li> <li><code>keydown</code></li> <li><code>keypress</code></li> <li><code>keyup</code></li> <li><code>mousedown</code></li> <li><code>mousemove</code></li> <li><code>mouseout</code></li> <li><code>mouseover</code></li> <li><code>mouseup</code></li> <li><code>select</code></li> </ul> <p>Additionally, JSF has two more special event names for <a href="http://docs.oracle.com/javaee/7/api/javax/faces/component/EditableValueHolder.html"><code>EditableValueHolder</code></a> and <a href="http://docs.oracle.com/javaee/7/api/javax/faces/component/ActionSource.html"><code>ActionSource</code></a> components, the <em>real</em> HTML DOM event being rendered depends on the component type:</p> <ul> <li><code>valueChange</code> (will render as <code>change</code> on text/select inputs and as <code>click</code> on radio/checkbox inputs)</li> <li><code>action</code> (will render as <code>click</code> on command links/buttons)</li> </ul> <p>The above two are the <em>default</em> events for the components in question.</p> <p>Some JSF component libraries have additional customized event names which are generally more specialized kinds of <code>valueChange</code> or <code>action</code> events, such as PrimeFaces <code>&lt;p:ajax&gt;</code> which supports among others <code>tabChange</code>, <code>itemSelect</code>, <code>itemUnselect</code>, <code>dateSelect</code>, <code>page</code>, <code>sort</code>, <code>filter</code>, <code>close</code>, etc depending on the parent <code>&lt;p:xxx&gt;</code> component. You can find them all in the "Ajax Behavior Events" subsection of each component's chapter in <a href="http://primefaces.org/documentation">PrimeFaces Users Guide</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload