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" action="#{counterView.increment}" update="output" />
</h:form>