a4j:include functionality is equal to the facelets ui:include functionality, plus, it enables the partial page navigation in an Ajax mode. The standard JSF navigation rules are used to define the navigation between the view.

viewId attribute specifies the view id of a page that will be included. It should be a full context-relative path of the resource in order to use as from-view and to-view in the JSF navigation cases.

Include example

The demo shows the example of three-steps wizard created using a4j:include. The navigation rules defined in the faces-config.xml are used to navigate between the steps of the wizard.

The Ajax command component (button, link, jsFunction, etc) should be located inside the a4j:include in order to have a partial navigation. When the navigation is performed, a part of the component tree content is replaced with the content of a view given by a navigation rule.

The content of the a4j:include is not isolated from the whole view. You can point to the other parts of the view with reRender if you want to update them while you navigate inside the a4j:include.