Nov 10, 2018

JSF: AJAX in Grouping of Components Example

<f:ajax event="click" render="@form">
    <h:form>
        <h:inputText id="input1" value="#{user.name}"/> 
        <h:commandButton id="Submit">
            <f:ajax event="keyup"/>
        </h:commandButton> 

        <h:commandButton id="Submit2">
            <f:ajax event="mouseover"/>
        </h:commandButton>
    </h:form>
</f:ajax>
All components are grouped by using the f:ajax tag.

When the user clicks either component, the updated results will be displayed for all components in the form.

Ajax functionality is cumulative. For command button "Submit", either click or keyup will fire an Ajax action.  For command button "Submit2", either click or mouseover will fire an Ajax action.