<?xml version='1.0' encoding='UTF-8'?>
<chapter>
  <chapterinfo>
    <keywordset>
      <keyword>a4j:page</keyword>
    </keywordset>
  </chapterinfo>
      <table>
      <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.components.Page</entry>
          </row>
          <row>
            <entry>component-family</entry>
            <entry>org.ajax4jsf.components.AjaxRegion</entry>
          </row>
          <row>
            <entry>component-class</entry>
            <entry>org.ajax4jsf.component.html.HtmlPage</entry>
          </row>
          <row>
            <entry>renderer-type</entry>
            <entry>org.ajax4jsf.components.AjaxPageRenderer</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  
  <section>
    <title>Creating on a page</title>
    <para>This component should be defined as a child component for <emphasis role="bold">
        <property>&lt;f:view&gt;:</property>
      </emphasis></para>
    <programlisting role="XML"><![CDATA[<f:view>
 <a4j:page>
     <f:facet name="head">
         <!--...Head Content here-->
     </f:facet>
   <!--...Page Content here-->
 </a4j:page>
</f:view>
]]></programlisting>
      </section>
  <section>
    <title>Creating the Component Dynamically Using Java</title>

  <para>
      <emphasis role="bold">Example:</emphasis>
 </para>
    <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.HtmlPage;
...
HtmlPage myPage = new HtmlPage();
...
]]></programlisting>
  </section>
  <section>
    <title>Facets</title>
    <table>
      <title>Facets</title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Facet name</entry>
            <entry>Description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>head</entry>
            <entry>Defines a head content</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </section>
  <section>
    <title>Key attributes and ways of usage</title>
    <para>The component is mostly used to solve the following problem with MyFaces for erlier Ajax4jsf versions: in MyFaces <emphasis role="bold">
        <property>&lt;f:view&gt;</property>
      </emphasis> doesn&apos;t get control over the 
        <property>RENDER_RESPONSE</property>
       phase, thus Ajax can&apos;t get control and make a response also. To avoid this problem it was necessary to use <emphasis role="bold">
        <property>&lt;a4j:page&gt;</property>
      </emphasis> on a page round the Ajax updatable area. In the last versions of both frameworks the problem is successfully  fixed and no <emphasis role="bold"><property>&lt;a4j:page&gt;</property></emphasis> usage is required.</para>
    <para>The component is rendered as a full HTML page template as it is shown in the <link linkend="exampl">example</link>. The 
      <property>head</property>
      section is defined with the help of the corresponding <emphasis><property>&quot;head&quot;</property></emphasis> facet.
      
      You do not need to use <emphasis><property>&quot;body&quot;</property></emphasis> facet in order to define first <property>body</property> section. 
      The second and more <property>body</property> sections is defined with the help of the corresponding <emphasis><property>&quot;body&quot;</property></emphasis> facet.
      
      </para>
      <para>
        The attribute <emphasis><property>&quot;format&quot;</property></emphasis> defines page layout format  for encoding DOCTYPE. 
      </para>
    <para>
        The attribute <emphasis><property>&quot;pageTitle&quot;</property></emphasis> is  rendered as <property>title</property> section.
    </para> 
    
     
    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[<a4j:page format="xhtml" pageTitle="myPage">
    <f:facet name="head">
        <!--Head Content here-->
    </f:facet>
   <!--Page Content Here-->
</a4j:page>
]]></programlisting>
    <para>This structure is rendered as:</para>
    
    <para id="exampl">
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head> 
        <title>myPage</title>
        <!--Head Content here-->
    </head> 
    <body>
        <!--Page Content Here-->
    </body> 
</html>]]></programlisting>
  </section>
  
  <section>
    <title>Relevant resources links</title>
	<para>
	  <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/page.jsf?c=page">Here</ulink> you can found some additional information for <emphasis role="bold"
	    ><property>&lt;a4j:page&gt;</property></emphasis> component usage.
	</para>  	
  </section>
  
</chapter>
