a4j:jsFunction component is very similar to a4j:commandButton, but allows to perform an Ajax request from a Javascript code directly. The component sends a request using a standard JSF approach, so the JSF form is required. The following example shows how the part of the page is re-rendered when a user hovers over the names.

name attribute defines the name of the function that will be generated. You can use it as a regular Javascript function name to invoke. a4j:actionparam is used to pass the function arguments (you can use f:param as well). The order and the number of parameters corresponds to the arguments of the called function. The value(s) of the a4j:actionparam will be replaced with the value of function arguments before the Ajax request is sent. To read more about a4j:action param visit .

As for any other Ajax components, you can use reRender attribute to update the area(s) of the page after an Ajax Response comes back. Also, you can use data attribute and oncomplete attribute to take the data from the server and use them for Javascript to call them. For additional information about Javascript oriented and other important attributes of a4j:jsFunction read .