Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
11g Release 1 (11.1.1.7.0)

E12419-09

<af:pageTemplateDef>

pageTemplateDef page template def


Defines a page template. Must not contain a document component.

Note about stretching layouts and flowing/scrolling layouts:

With today's web browsers, it is not reliable to have vertically-stretched content inside of areas that also have scroll bars. If you want the outer areas of your page structure to stretch, you need to be careful of how you assemble your component tree. First, build up a structure of stretchable components (using panelSplitters and panelStretchLayouts). Second, inside of this structure, create islands of non-stretched content. These islands should be rooted with panelGroupLayouts with layout="scroll". This is an ideal component because it can be stretched and does not stretch its children--which likely don't support being stretched anyway. Rules of thumb: 1.) Never place a scrolling panelGroupLayout inside of another scrolling panelGroupLayout since users do not like nested scroll bars. 2.) Never specify percentage heights in any component's inlineStyle attribute. 3.) Never use the "position" style in any component's inlineStyle attribute. 4.) Unless you are using fixed pixel heights on them, you would never place a panelSplitter or panelStretchLayout inside of any panelGroupLayout regardless of what you have set its layout attribute to. If you believe that you need to break one of these rules, this is an indication that your page structure is not following the page structure guidelines and you will likely have troubles getting your application to render consistently across various web browsers and computing platforms. For specific details of about component stretching, please see the "geometry management" section in the tag documentation of each component. See the demo application for real world layout examples that you can use as a starting point in your application. A good starting point is the "Layout Basics" page listed under the "Framework Features" tab of the demo application.

Example page template definition:


<?xml version='1.0' encoding='utf-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          version="1.2">
  <af:pageTemplateDef var="attrs">
    <af:xmlContent>
      <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
        <description>
        This component will show weather forecasts in a box.
        </description>
        <facet>
          <facet-name>forecastSummary</facet-name>
          <description>This child draws out the summary forecast</description>
        </facet>
        <facet>
          <facet-name>forecastDetail</facet-name>
          <description>This child draws out the detailed forecast</description>
        </facet>
        <attribute>
          <attribute-name>zip</attribute-name>
          <description>The Zip code of the area</description>
          <required>true</required>
        </attribute>
        <attribute>
          <attribute-name>description</attribute-name>
          <default-value>Unknown</default-value>
          <description>The city/state of the zip code </description>
        </attribute>
      </component>
    </af:xmlContent>
    <af:panelHeader text="Weather Forecast for Zip: #{attrs.zip}, #{attrs.description}">
      <af:facetRef facetname="forecastSummary"/>
      <af:showDetail>
        <af:facetRef facetname="forecastDetail"/>
      </af:showDetail>
    </af:panelHeader>
  </af:pageTemplateDef>        
</jsp:root>

Example page template usage:


<af:pageTemplate id="weather" viewid="pagefragments_weatherBox_jspx"
  zip="94065" description="Redwood Shores, CA">
  <f:facet name="forecastSummary">
    <af:outputText value="Partly Cloudy"/>
  </f:facet>
  <f:facet name="forecastDetail">
    <af:panelGroupLayout layout="vertical">
      <af:outputText value="72 Degrees F"/>
      <af:outputText value="Partly Cloudy"/>
      <af:outputText value="Wind: W at 16 mph"/>
      <af:outputText value="Humidity: 46%"/>
    </af:panelGroupLayout>
  </f:facet>
</af:pageTemplate>

Attributes

Name Type Supports EL? Description
var String No The name of the EL variable to use to reference attributes defined on this page template's usage.
componentVar String No The name of the EL variable to use to reference component defined on this page template's usage.
definition String No The definition of the pageTemplate. Acceptable values are:
  • 'public': indicates that the structure of the Page Template will not change and that 'external references to' and 'operations on' the Page Template can be made from outside the Page Template. Customizations on components that are direct children of a Page Template will be persisted by FilteredPersistenceChangeManager via the 'Persistent Change Manager' registered in adf-config.xml. The direct children of the Page Template can be referenced in the 'partialTriggers' attribute. The Page Template author should clearly document any implementation specific meaning to 'public' definition.
  • 'private': indicates that the structure of the Page Template can change and that 'external references to' and 'operations on' the Page Template can not be made from outside the Page Template. Customizations on components that are direct children of a Page Template will not be persisted by FilteredPersistenceChangeManager via the 'Persistent Change Manager' registered in adf-config.xml. The direct children of the Page Template can not be referenced in the 'partialTriggers' attribute. The Page Template author should clearly document any implementation specific meaning to 'private' definition.