### Create new RichFaces Documentation Jira issue

Summary
255 characters left
Description
Environment
This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.org Community Documentation

- Prev
- Next

### 6.1.3. < a4j:form > available since 3.0.0

expand all

#### 6.1.3.1. Description

The <a4j:form> component enhances functionality of the standard JSF <h:form> component with possibility of default Ajax submission and fixes the problem with <h:commandLink> generation inside the form.

#### 6.1.3.2. Details of Usage

Along with a4j:htmlCommandLink , <a4j:form> component fixes the problem of <h:commandLink> component that cannot be re-rendered without re-rendering the whole form it belongs to. For the further details see the Ajax Form Usage page at RichFaces Livedemo.

The <a4j:form> component adds extra functionality to non-Ajax action/command components: submission is performed via Ajax when "ajaxSubmit" attribute set to "true".

If the <a4j:form> component works in an Ajax mode, the standard Ajax attributes such as "reRender" , "limitToList" , "requestDelay" , etc. can be used.

Example:

    ...

    <a4j:form ajaxSubmit="true" reRender="name">

        <h:panelGrid>

            <h:commandButton value="Set Local Name to John (Ajax)" action="#{userBean.nameItJohn}" />

            <h:outputText id="name" value="Name:#{userBean.name}" />

        </h:panelGrid>

    </a4j:form>

    ...

Here is a managed bean:

    ...

    public class UserBean {

        private String name="";

        public String nameItJohn() {

            setName("John");

            return null;

        }

        public String getName() {

            return this.name;

        }

        public void setName(String name) {

            this.name = name;

        }

    }

    ...

In the example above the `ajaxSubmit="true"`, so all standard action components on this form become ajaxable. The "reRender" attribute contains an Id of component for re-rendering after an Ajax response.

## Tip:

If you have <h:commandButton> or <h:commandLink> inside a form, they work as <a4j:commandButton> .

## Note:

You should not use <a4j:form> component with `ajaxSubmit="true"` if it contains other Ajax command components. Also, due to the security reason, file upload form element cannot be convertible to the be ajaxable.

#### 6.1.3.3. Reference Data

Table of <a4j:form> attributes.

Table 6.3. Component Identification Parameters

Name | Value
--- | ---
component-type | org.ajax4jsf.Form
component-family | javax.faces.Form
component-class | org.ajax4jsf.component.html.AjaxForm
renderer-type | org.ajax4jsf.FormRenderer

#### 6.1.3.4. Relevant Resources Links

Visit Ajax Form page at RichFaces Livedemo for examples of component usage and their sources.

For additional information about attributes of this component read 'Ajax Attribute section.

- Prev6.1.2. < a4j:actionparam ...
- Top of page
- Front page
- Next6.1.4. < a4j:region > ...