Chapter 4. Common Ajax attributes
The Ajax components in the
a4j library share common attributes to perform similar functionality. Most RichFaces components in the rich library that feature built-in Ajax support share these common attributes as well.
Most attributes have default values, so they need not be explicitly set for the component to function in its default state. These attributes can be altered to customize the behavior of the component if necessary.
4.1. Data processing
The RichFaces Ajax script is built on a base of the JSF 2 Ajax script. As such, each time a request is sent, the data from the requesting component's parent JSF form is submitted along with the XMLHTTPRequest object. The form data contains values from the input element and auxiliary information such as state-saving data.
4.1.1. execute
The
execute attribute allows JSF processing to be limited to defined components. 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- Every component is processed.
@none- No components are processed.
@this- The requesting component with the
executeattribute is processed. This is the default behavior for components. @form- The form that contains the requesting component is processed.
@region- The region that contains the requesting component is processed. Use the
<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 this book.
4.1.2. bypassUpdates
If the
bypassUpdates attribute is set to true, the Update Model phase of the request processing lifecycle is bypassed. This is useful if user input needs to be validated but the model does not need to be updated. This is the opposite functionality to the execute attribute in RichFaces.