Ajax Framework - Counter An integer variable is incremented each time the button is clicked and current value is updated with ajax.
Counter: 0
<h:form>
    <h:panelGrid columns="2" cellpadding="5">
        <h:outputText value="Counter: " />
        <h:outputText id="output" value="#{counterView.number}" />
    </h:panelGrid>

    <p:commandButton value="Count" actionListener="#{counterView.increment}" update="output" />
</h:form>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.1.4 on Mojarra-2.2.10.