RichFaces AJAX request indicator with absolute positioning

RichFaces comes with a4j:status tag that allows to show AJAX request status. Here is an example how to create a page-level indicator, in other words, any action from this page will trigger the status to be displayed. It’s one way to tell the user that something is happening. Technically, the a4j:status is associated with the closest a4j:region. By default the entire page is a region (even though we don’t put it on the page).

<a4j:status id="stateStatus" startText="Working..."
   startStyle="background-color: #ffA500;
   font-weight:bold;
   position: absolute; 
   right: 5px; 
   top: 1px; 
   width: 100px;" />  
  <h:form>
  	all other controls...
  </h:form>

The status will be displayed in the upper right corner of the browser:

We are only showing a status when a request is being processed. You can also show a status when the request is done (or not executing) by setting stopText attribute. Lastly, if you want to include something other than text, two facets are available to include any content you want: start and status.

5 comments

  1. Pingback: News RichFaces AJAX request indicator with absolute positioning | Web 2.0 Designer
  2. max

    I think is should work. For portlets, it makes sense to use individual status indicators, otherwise the one indicator could be overloaded by each portlet instance.

  3. max

    Something like this:

    <a4j:commandButton value="Click" status="myStatus"/>
    ...
    <a4j:status id="myStatus" startText="Working..."/>

    or

    <a4j:region id="myRegion">
     
    </a4j:region>
    <a4j:status for="myRegion" startText="Working..."/>

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Notify me of followup comments via e-mail. You can also subscribe without commenting.