Component identification parameters

Name | Value
--- | ---
component-type | org.ajax4jsf.Include
component-family | javax.faces.Output
component-class | org.ajax4jsf.component.html.Include
renderer-type | org.ajax4jsf.components.AjaxIncludeRenderer

## Creating on a page

To use the component, it's necessary to place the following strings on a page:

Example:

    <h:panelGroup id="wizard">
    		<a4j:include  viewId="/pages/include/first.xhtml" />
    </h:panelGroup>

For navigation inside a page defined in viewId any components responsible for Ajax requests to the server generation are used.

For example, the following component on a page "/pages/include/first.xhtml"

Example:

    ...
    <a4j:commandButton action="next" reRender="wizard"/>
    ...

And in faces-config it's defined:

Example:

    <navigation-rule>
      <from-view-id>/pages/include/first.xhtml</from-view-id>
      <navigation-case>
       <from-outcome>next</from-outcome>
       <to-view-id>/pages/include/second.xhtml</to-view-id>
      </navigation-case>
     </navigation-rule>

In this case after a click on a button defined inside "first.xhtml" view, navigation is performed after an Ajax request (the same as standard JSF one) only inside this view.

## Dynamical creation of a component from Java code

    <import org.ajax4jsf.component.html.Include;
    ...
    Include myInclude = new Include();
    ...

If <a4j:include> is defined this way, any Ajax request returning outcome inside generates navigation with this <a4j:include> .

Ajax Action for navigation implementation inside view must be placed inside <a4j:include> pages. Navigation defined by these pages is applied to the <a4j:include> element current for them.

As in the general case for Ajax Action component, if the <a4j:action> component inside <a4j:include> returns outcome defined as <redirect/>, Ajax submit is performed with navigation of the whole page and not only of the current view.

## Relevant resources links

Here you can see the example of <a4j:include> usage and sources for the given example.

Some additional information can be found on the Ajax4Jsf Users Forum.