View Source

h1. Comparing Automatic Ajax with Standard JSF Ajax
h2. JSF <f:ajax>
JSF 2.0 includes Ajax capabilities with the _<f:ajax>_ tag. _<f:ajax>_ adds client-side behavior to it's parent component, enabling it to perform an Ajax submission, cause execution of the JSF lifecycle, and ultimately render new view content to be inserted in the page. The page designer controls what type of event causes the submit to occur, and defines what components participate in the execute phase, and what components must render as a result of the execute. The following page snippet illustrates an input field causing an output field to update once the user modifies and exits the input field.

<h:panelGrid columns="1">
<h:inputText id="myinput" value="#{myBean.value}">
<f:ajax execute="@this" event="blur" render="myoutput"/>
<h:outputText id="myoutput" value="#{myBean.value}"/>
The application of _<f:ajax>_ is simple in a simple use case such as this, but as page complexity increases so does the complexity of defining appropriate _<f:ajax>_ tags, and if you get it wrong your application can become ill behaved.