Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.1.12.  < a4j:status > available since 3.0.0

The <a4j:status> component generates elements for displaying of the current Ajax requests status. There are two status modes: Ajax request is in process or finished.

Table 6.24. a4j : status attributes

Attribute Name Description
binding JSF: The attribute takes a value-binding expression for a component property of a backing bean
dirHTML: Direction indication for text that does not inherit directionality. Valid values are "LTR" (left-to-right) and "RTL" (right-to-left)
forID of the AjaxContainer component whose status is indicated (in the format of a javax.faces.UIComopnent.findComponent() call).
forceIdIf true, render the ID of the component in HTML code without JSF modifications.
id JSF: Every component may have a unique id that is automatically created if omitted
langHTML: Code describing the language used in the generated markup for this component
layoutDefine visual layout of panel, can be "block" or "inline".
onclick DHTML: The client-side script method to be called when the element is clicked
ondblclick DHTML: The client-side script method to be called when the element is double-clicked
onkeydown DHTML: The client-side script method to be called when a key is pressed down over the element
onkeypress DHTML: The client-side script method to be called when a key is pressed over the element and released
onkeyup DHTML: The client-side script method to be called when a key is released
onmousedown DHTML: The client-side script method to be called when a mouse button is pressed down over the element
onmousemove DHTML: The client-side script method to be called when a pointer is moved within the element
onmouseout DHTML: The client-side script method to be called when a pointer is moved away from the element
onmouseover DHTML: The client-side script method to be called when a pointer is moved onto the element
onmouseup DHTML: The client-side script method to be called when a mouse button is released
onstartThe client-side script method to be called at the start of the request
onstopThe client-side script method to be called when the request is finished
rendered JSF: If "false", this component is not rendered
startStyleCSS style rules to be applied to the element displayed when a request is in progress
startStyleClassAssigns one or more space-separated CSS class names to the element displayed when a request is in progress
startTextText to display on starting request.
stopStyleCSS style rules to be applied to the element displayed on a request completion
stopStyleClassAssigns one or more space-separated CSS class names to the element displayed on a request completion
stopTextText for display on request complete.
styleHTML: CSS style rules to be applied to the component
styleClass JSF: Assigns one or more CSS class names to the component. Corresponds to the HTML "class" attribute.
titleHTML: Advisory title information about markup elements generated for this component

Table 6.25. Component identification parameters

NameValue
component-typeorg.ajax4jsf.Status
component-familyjavax.faces.Panel
component-classorg.ajax4jsf.component.html.HtmlAjaxStatus
renderer-typeorg.ajax4jsf.components.AjaxStatusRenderer


There are two ways to define elements indicating a request status :

Example:

import org.ajax4jsf.component.html.HtmlAjaxStatus;

...
HtmlAjaxStatus  myStatus = new HtmlAjaxStatus();
...

There are two ways for the components or containers definition, which Ajax requests status is tracked by a component.

The component creates two <span> or <div> elements depending on attribute "layout" with content defined for each status, one of the elements (start) is initially hidden. At the beginning of an Ajax request, elements state is inversed, hence the second element is shown and the first is hidden. At the end of a response processing, elements display states return to its initial values.

Example:


<a4j:status startText="Started" stopText="stopped" />

The code shown in the example above is decoded on a page as:


<span id="j_id20:status.start" style="display: none">
     Started
</span>
<span id="j_id20:status.stop">
     Stopped
</span>

and after the generation of an Ajax response is changed to:


<span id="j_id20:status.start">
     Started
</span>
<span id="j_id20:status.stop" style="display: none">
     Stopped
</span>

There is a possibility to group a <a4j:status> elements content into <div> elements, instead of <span> . To use it, just redefine the "layout" attribute from "inline" (default) to "block".

Vizit Status page at RichFaces Livedemo for examples of component usage and their sources.

Useful articles at JBoss portal:

  • RichFacesPleaseWaitBox describes how to show a "Please Wait" box and block the input while the Ajax request is processed using combination of <a4j:status> and <rich:modalPanel> .