Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
11g Release 2 (11.1.2.0.0)

E17491-02

<af:pageTemplate>

af:pageTemplate pageTemplate page template

UIComponent class: oracle.adf.view.rich.component.rich.fragment.RichPageTemplate
Component type: oracle.adf.RichPageTemplate

Naming container: Yes. When referring to children of this component ("partialTriggers", findComponent(), etc.), you must prefix the child's ID with this component's ID and a colon (':')

Renders a pageTemplate. If you want a common UI for all your pages, you may use a pageTemplate. This allows you to define your common UI in a pageTemplate definition file using the <af:pageTemplateDef> tag, and reusing the common definition on all your other pages using this tag. The document component needs to be the root component and must not be placed inside of a af:pageTemplateDef.

You can pass attributes using JSP tag attributes, or by using <f:attribute>. Facets can also be set as normal using <f:facet> tags. The definition can refer to the attributes of the component by using the "var" EL variable and the component itself using the "componentVar" EL variable that are setup on the <af:componentDef> tag. The definition can reference a facet using the <af:facetRef> tag. Each facet can only be referenced once.

Example:

<af:pageTemplate id="weather"
  viewid="pagefragments_weatherBox_jspx">
  <f:attribute name="zip" value="94065"/>
  <f:attribute name="description" value="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'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>

And this is the corresponding pagefragments/weatherBox.jspx:

<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="2.0">
  <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>

The pageTemplate component does not support nesting a bound template inside of a non-bound page template. When using ADF model binding, the entire hierarchy of page templates must be bound. If this is not done, the page template will inherit the bindings of its including page and not use the page definition defined for the template.

Bound page templates may not be placed inside stamping components like the <af:iterator> component as the page template model does not currently supported being stamped. If necessary, page templates can be replicated using <af:forEach>, provided that each iteration has its own model.

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.

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.

Geometry Management

Events

Type Phases Description
org.apache.myfaces.trinidad.event.AttributeChangeEvent Invoke Application,
Apply Request Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.

Attributes

Name Type Supports EL? Description
attributeChangeListener javax.el.MethodExpression Only EL a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.
binding oracle.adf.view.rich.component.rich.fragment.RichPageTemplate Only EL an EL reference that will store the component instance on a bean. This can be used to give programmatic access to a component from a backing bean, or to move creation of the component to a backing bean.
customizationId String Yes This attribute is deprecated. The 'id' attribute should be used when applying persistent customizations. This attribute will be removed in the next release.
id String Yes The identifier for the component. The identifier must follow a subset of the syntax allowed in HTML
partialTriggers String[] Yes the IDs of the components that should trigger a partial update. This component will listen on the trigger components. If one of the trigger components receives an event that will cause it to update in some way, this component will request to be updated too. Identifiers are relative to the source component (this component), and must account for NamingContainers. If your component is already inside of a naming container, you can use a single colon to start the search from the root of the page, or multiple colons to move up through the NamingContainers - "::" will pop out of the component's naming container (or itself if the component is a naming container) and begin the search from there, ":::" will pop out of two naming containers (including itself if the component is a naming container) and begin the search from there, etc.
rendered boolean Yes Default Value: true

whether the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible on the client). If you want to change a component's rendered attribute from false to true using PPR, set the partialTrigger attribute of its parent component so the parent refreshes and in turn will render this component.
value Object Yes If this attribute is set to an instance of oracle.adf.view.rich.model.PageTemplateModel, the view ID will be taken from the model and the model will receive notifications of the starting and stopping of the template context. Otherwise, if the value is non-null the value is assigned to the "bindings" EL variable while this template is rendering or decoding.
viewId String Yes This is the viewId of the resource that contains the definition for this pageTemplate. Typically this points to another jsp page, that begins with the <af:pageTemplateDef/> tag.

If the value attribute of the page template resolves to an instance of PageTemplateModel then the view ID will be retrieved from the the model instead of using the viewId tag attribute.