Home » RichFaces a4j:CommandButton

RichFaces a4j:CommandButton

by Online Tutorials Library

RichFaces <a4j:commandButton>

The <a4j:commandButton> component is similar to the JavaServer Faces ( JSF) <h:commandButton> component, but additionally includes Ajax support.

It requires only one value attribute to be used. We can use it to set text for the command button.

By default, the <a4j:commandButton> uses the click event instead of the submit event.

Note – The <a4j:commandButton> component has the execute=”@form” setting by default. To limit rendering to a different scope, redefine the execute attribute.


Example

Here, in the following example, we are implementing <a4j:commandButton> component. This example contains the following files.

JSF File

// commandButton.xhtml

Managed Bean

// User.java

Output:

RichFaces A4j commandbutton 1


You may also like