<?xml version='1.0' encoding='UTF-8'?>
<chapter>
  <chapterinfo>
    <keywordset>
      <keyword>a4j:include</keyword>
    </keywordset>
  </chapterinfo>
     <table frame="all">
         <title>Component identification parameters</title>
        <tgroup cols="2">
	  <thead>
            <row>
                <entry>Name</entry>
                <entry>Value</entry>
            </row>
        </thead>
          <tbody>
            <row>
              <entry>component-type</entry>
              <entry>org.ajax4jsf.Include</entry>
            </row>
            <row>
              <entry>component-family</entry>
              <entry>javax.faces.Output</entry>
            </row>
            <row>
              <entry>component-class</entry>
              <entry>org.ajax4jsf.component.html.Include</entry>
            </row>
            <row>
              <entry>renderer-type</entry>
              <entry>org.ajax4jsf.components.AjaxIncludeRenderer</entry>
            </row>
          </tbody>
        </tgroup>
      </table>
  
  <section>
        <title>Creating the Component with a Page Tag</title>
        <para>
              To create the simplest variant of the component on a page use the following syntax:
        </para>
        <para>
              <emphasis role="bold">Example:</emphasis>
        </para>
        <programlisting role="XML"><![CDATA[<h:panelGrid>
      <a4j:include  viewId="/pages/include/first.xhtml" />
</rich:panelGrid>]]></programlisting>
  </section>
      
      <section>
            <title>Creating the Component Dynamically Using Java</title>
            <para>
                  This component cannot be created dynamically.
            </para>
      </section>
      
      <section>
            <title>Details of usage</title>
            <para>
                  The component is used to include one view as part of another and may be put anywhere in the page code. 
                  The <emphasis><property>&apos;viewID&apos;</property></emphasis> attribute is used to point at the part to be included and should present a full context-relative path of the resource in order to be used as from-view and to-view in the JSF navigation cases. 
                  In general the component functions as Fecelets <emphasis role="bold"><property>&lt;ui:include&gt;</property></emphasis> tag but with partial page navigation in Ajax mode as an advantage.
            </para>
                  <note>
                        <title>Note:</title>
                        <para>
                              To make the RichFaces<emphasis role="bold"><property>&lt;a4j:include&gt;</property></emphasis> component (as well as Facelets<emphasis role="bold"><property>&lt;ui:include&gt;</property></emphasis> tag) work properly when including the part of the page check that included page does not generates extra HTML &lt;!DOCTYPE&gt;, &lt;html&gt;, &lt;body&gt; tags.
                        </para>
                  </note>
          
          <para>
                The navigation rules could look as following:
          </para>
            
            <para>
                  <emphasis role="bold">Example:</emphasis>
            </para>
            <programlisting role="XML"><![CDATA[<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>]]></programlisting>
            
      </section>
      
      
  <section>
    <title>Relevant resources links</title>
    <para>
          Vizit the <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/include.jsf?c=include">Include page</ulink> for examples of component usage and their sources. 
    </para>
        
  </section>
</chapter>