The a4j:status component is an indicator of an Ajax request. It has two states: start and stop. The start state indicates that an Ajax request is in progress. When an Ajax Response is returned, the component switches to the stop state.
The a4j:status component could be defined as follows:
This example shows a view-scoped a4j:status component. It should be defined outside of any forms, and will handle all the Ajax requests within the view.
<!DOCTYPE html> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:panelGrid columns="3"> <h:form> <rich:panel id="panel"> <f:facet name="header"> <h:outputText value="User Details Panel" /> </f:facet> <h:panelGrid columns="2"> <a4j:ajax event="keyup" listener="#{userBean.causeDelay}"> <h:outputText value="User name:" /> <h:inputText value="#{userBean.name}" /> <h:outputText value="Address:" /> <h:inputText value="#{userBean.address}" /> </a4j:ajax> </h:panelGrid> <h:commandButton value="Submit" type="button" action="#{userBean.storeWithDelay}"> <a4j:ajax render="out" /> </h:commandButton> <h:outputText value="#{userBean.recordStatus}" id="out" /> </rich:panel> </h:form> <h:form> <rich:panel> <f:facet name="header"> <h:outputText value="Simple search panel" /> </f:facet> <h:inputText value="Search..." /> <a4j:commandButton value="Submit" type="button" action="#{userBean.causeDelay}"/> </rich:panel> </h:form> <a4j:status> <f:facet name="start"> <h:graphicImage value="/images/ai.gif" alt="ai" /> </f:facet> </a4j:status> </h:panelGrid> </ui:composition>