Automatic Ajax

You are viewing an old version (v. 2) of this page.
The latest version is v. 27, last edited on Apr 10, 2013 (view differences | )
<< View previous version | view page history | view next version >>

Comparing Automatic Ajax with Standard JSF Ajax

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:form>
    <h:panelGrid columns="1">
        <h:inputText id="myinput" value="#{myBean.value}">
            <f:ajax execute="@this" event="blur" render="myoutput"/>
        </h:inputText>
        <h:outputText id="myoutput" value="#{myBean.value}"/>
    </panelGrid>
</h:form>

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.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2017 ICEsoft Technologies Canada Corp.