June 2014
Intermediate to advanced
578 pages
12h 2m
English
The simplest JSF-AJAX example can be written in a matter of a few seconds. Let's consider a JSF form with an input text and a button that sends the user input to the server. The user input (a string) is converted by the server to uppercase and is displayed to the user in an output text component. Next, you can ajaxify this scenario as shown in the following example code:
<h:form>
<h:inputText id="nameInputId" value="#{ajaxBean.name}"/>
<h:commandButton value="Send" action="#{ajaxBean.ajaxAction()}">
<f:ajax/>
</h:commandButton>
<h:outputText id="nameOutputId" value="#{ajaxBean.name}"/>
</h:form>The presence of the <f:ajax> tag is sufficient to transform this request into an AJAX request. Well, it is true ...
Read now
Unlock full access