a4j:page

Component identification parameters

Name | Value
--- | ---
component-type | org.ajax4jsf.components.Page
component-family | org.ajax4jsf.components.AjaxRegion
component-class | org.ajax4jsf.component.html.HtmlPage
renderer-type | org.ajax4jsf.components.AjaxPageRenderer

## Creating on a page

This component should be defined as a child component for <f:view>:

    <f:view>
         <a4j:page>
              <f:facet name="head">
                  <!--...Head Content here-->
              </f:facet>
              <!--...Page Content here-->
          </a4j:page>
    </f:view>

## Creating the Component Dynamically Using Java

Example:

    import org.ajax4jsf.component.html.HtmlPage;
    ...
    HtmlPage myPage = new HtmlPage();
    ...

## Facets

Facets

Facet name | Description
--- | ---
head | Defines a head content

## Key attributes and ways of usage

The component is mostly used to solve the following problem with MyFaces for erlier Ajax4jsf versions: in MyFaces <f:view> doesn't get control over the RENDER_RESPONSE phase, thus Ajax can't get control and make a response also. To avoid this problem it was necessary to use <a4j:page> on a page round the Ajax updatable area. In the last versions of both frameworks the problem is successfully fixed and no <a4j:page> usage is required.

The component is rendered as a full HTML page template as it is shown in the example. The head section is defined with the help of the corresponding "head" facet. You do not need to use "body" facet in order to define first body section. The second and more body sections is defined with the help of the corresponding "body" facet.

The attribute "format" defines page layout format for encoding DOCTYPE.

The attribute "pageTitle" is rendered as title section.

Example:

    <a4j:page format="xhtml" pageTitle="myPage">
        <f:facet name="head">
            <!--Head Content here-->
        </f:facet>
       <!--Page Content Here-->
    </a4j:page>

This structure is rendered as:

Example:

    <!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>

## Relevant resources links

On RichFaces LiveDemo page you can found some additional information for <a4j:page> component usage.