JBoss.orgCommunity Documentation

Chapter 4. Basic concepts

4.1. Sending an Ajax request
4.2. Receiving events and client-side updates
4.2.1. Partial page updates
4.3. Component overview

Documentation in development

Some concepts covered in this chapter may refer to the previous version of Richfaces, version 3.3.3. This chapter is scheduled for review to ensure all information is up to date.

Read this chapter for the basic concepts of using RichFaces in conjunction with Ajax and JavaServer Faces.

Many of the tags in the a4j and rich tag libraries are capable of sending Ajax requests from a JavaServer Faces (JSF) page. RichFaces tags hide the usual JavaScript activities that are required for an XMHTTPRequest object building and an Ajax request sending. Additionally the tags can determine which components of a JSF page are to be re-rendered as a result of the Ajax response; refer to Section 4.2.1, “Partial page updates” for details.

  • The <a4j:commandButton> and <a4j:commandLink> tags are used to send an Ajax request on the click JavaScript event.

  • The <a4j:poll> tag is used to send an Ajax request periodically using a timer.

  • The <a4j:ajax> tag allows you to add Ajax functionality to standard JSF components and send Ajax request on a chosen JavaScript event, such as keyup or mouseover, for example.

  • Most components in the rich tag library have built-in Ajax support. Refer to the RichFaces Component Reference for details on the use of each component.

Updates are made only to those regions specified using the execute. If no specific regions are declared, the whole page is updated when an Ajax response is received.

The RichFaces framework is made up of two tag libraries: the a4j library and the rich library. The a4j tag library represents Ajax4jsf, which provides page-level Ajax support with core Ajax components. This allows developers to make use of custom Ajax behavior with existing components. The rich tag library provides Ajax support at the component level instead, and includes ready-made, self-contained components. These components don't require additional configuration in order to send requests or update.

For details on the use of the various components, refer to RichFaces Component Reference.