Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.13.1.  < rich:page > available since 3.3.1

The <rich:page> component is used to create basic (X)HTML markup and define document parameters like DOCTYPE, title etc. The component also allows to build top level layout: header, bottom, center and left or right layout areas.

The <rich:page> component together with the <rich:layout> component provides a full-fledged mechanism for markup creation.

First of all, to declare the document type of the page you should use the "markupType" attribute which has the following values:

The default value is "html".

The "contentType" allows to specify the type of the content and encoding for the page.

The title of the page can be set with the "pageTitle" attribute. To place some other page parameters (like meta information, links to CSS style sheets etc.) in the <head> element of an HTML page use "pageHeader" facet.

Example:


...
<rich:page pageTitle="The title of the page" markupType="xhtml">
    <f:facet name="pageHeader">
        <meta content="The rich:page component" name="keywords" />
        <link rel="shortcut icon" href="/images/favicon.ico" />
        <link href="/css/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/js/menu.js"></script>
    </f:facet>
    <!-- page content -->
</rich:page>
...

The implementation of the <rich:page> component provides four facets that you can use to arrange the layout of the page: "header", "subheader", "sidebar" and "footer". Their behavior is quite self-explanatory.

The position of the panel rendered by the "sidebar" facet can be set with the "sidebarPosition" attribute that can take either "right" or "left" as values, you can also specify the width for this facet with the "sidebarWidth" attribute.

Example:


...
<rich:page sidebarPosition="left" sidebarWidth="300">
    <f:facet name="header">
        <!-- header  content -->
    </f:facet>
    <f:facet name="sidebar">
        <!-- side panel content -->
    </f:facet>
    <!-- body content -->
    <f:facet name="footer">
        <!-- footer  content -->
    </f:facet>
</rich:page>
...

The <rich:page> component also provides attributes to define CSS classes for each nested facet as well as a body part of the page created with the component.

Several templates are available for the <rich:page> component. A template can be activated with the "theme" attribute.

The theme defines the way the <rich:page> is rendered. Default renderer (default theme) of the <rich:page> has no mappings to skin parameters and just provides CSS classes for the page part. However, the simple theme, which is an extension of the default theme, has mappings to skin parameters and adds the RichFaces skinning for the page elements.

As a whole, RichFaces provides 4 themes for the <rich:page> component out-of-the-box: "simple", "violetRays", "oldschool", "smooth". The Creating a Theme for <rich:page> article tells how you can create your custom theme for the <rich:page> component.

Table of <rich:page> attributes.




On the component Live Demo page you can see the example of <rich:page> component usage and sources for the given example.

The Layout components for RichFaces 3.3.1 on the JBoss.org Wiki

Refer to the "Changing the layout of the page dynamically" to find out how to change the layout of a page on the fly with <rich:page>.