JBoss.orgCommunity Documentation
Read this chapter for the basic concepts of using RichFaces in conjunction with Ajax and JavaServer Faces.
Many of the tags in the r
tag library are capable of sending Ajax requests from a JavaServer Faces (JSF) page.
<a4j:commandButton>
and <a4j:commandLink>
tags are used to send an Ajax request on the click
JavaScript event.
<a4j:poll>
tag is used to send an Ajax request periodically using a timer.
<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.
r
tag library have built-in Ajax support. Refer to the RichFaces Component Reference for details on the use of each component.
Use the execute
attribute to specify which parts of the JSF tree to process during an Ajax request. The execute
attribute can point to an id
identifier of a specific component to process. Components can also be identified through the use of Expression Language (EL).
Alternatively, the execute
attribute accepts the following keywords:
@all
@none
@this
execute
attribute is processed.
@form
@region
<a4j:region>
component as a wrapper element to specify regions.
Some components make use of additional keywords. These are detailed under the relevant component entry in the RichFaces Component Reference .
Use the render
attribute to specify which components to render for an Ajax update. The render
attribute can point to an id
identifier of a specific component to update. Components can also be identified through the use of Expression Language (EL).
Alternatively, the render
attribute accepts the following keywords:
@all
@none
@this
execute
attribute is updated.
@form
@region
<a4j:region>
component as a wrapper element to specify regions.
Some components make use of additional keywords. These are detailed under the relevant component entry in the RichFaces Component Reference .
Use the <a4j:outputPanel>
component with the ajaxRendered="true"
setting to always update a section irrespective of the requesting component’s render
attribute. The <rich:message>
and <rich:messages>
components are based on the <a4j:outputPanel>
component, and as such will also always be updated. To override this behavior, use the limitRender="true"
setting on the requesting component.
The RichFaces framework is made up of two tag libraries: the rich
and a4j
libraries. The a4j
tag library includes both the low-level ajax functionality, while the rich
tag library includes the high-level components for building web applications. This allows developers to make use of custom Ajax behavior with existing componentsas well as leverage the many 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 .