Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 2 (11.1.2.3.0)
E17488-04


oracle.adf.view.rich.component.fragment
Class UIXPageTemplate

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by org.apache.myfaces.trinidad.component.UIXComponent
          extended by org.apache.myfaces.trinidad.component.UIXComponentBase
              extended by oracle.adf.view.rich.component.fragment.ContextSwitchingComponent
                  extended by oracle.adf.view.rich.component.fragment.UIXInclude
                      extended by oracle.adf.view.rich.component.fragment.UIXPageTemplate

All Implemented Interfaces:
java.util.EventListener, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, org.apache.myfaces.trinidad.component.FlattenedComponent
Direct Known Subclasses:
RichPageTemplate

public class UIXPageTemplate
extends UIXInclude

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.

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.

Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static org.apache.myfaces.trinidad.bean.FacesBean.Type TYPE
           
static org.apache.myfaces.trinidad.bean.PropertyKey VALUE_KEY
           

 

Fields inherited from class oracle.adf.view.rich.component.fragment.UIXInclude
COMPONENT_VAR_KEY, VAR_KEY, VIEW_ID_KEY

 

Fields inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
BINDING_KEY, ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY

 

Fields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY

 

Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR

 

Constructor Summary
  UIXPageTemplate()
          Construct an instance of the UIXPageTemplate.
protected UIXPageTemplate(java.lang.String rendererType)
          Construct an instance of the UIXPageTemplate.

 

Method Summary
protected  org.apache.myfaces.trinidad.bean.FacesBean.Type getBeanType()
           
 java.lang.String getFamily()
           
 java.lang.Object getValue()
          Gets 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.
 java.lang.String getViewId()
          Gets the view ID.
 void resumeContext(javax.faces.context.FacesContext facesContext)
          Resume the include's context that has been suspended.
protected  void setPartialTarget(javax.faces.context.FacesContext facesContext, org.apache.myfaces.trinidad.context.PartialPageContext partialContext)
          When asked to be PPR-ed, Page Template should PPR its parent since it renders no DOM
protected  void setupChildrenVisitingContext(javax.faces.context.FacesContext context)
          Setups EL variables including the attribute map for use by the children of this page templete.
 void setValue(java.lang.Object value)
          Sets 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.
protected  org.apache.myfaces.trinidad.context.SuspendCallback.SuspendResult suspendChange(org.apache.myfaces.trinidad.context.ComponentContextChange contextChange)
          Called by the UIXInclude.suspendContext(FacesContext) method to determine how far back to suspend the application context changes.
 void suspendContext(javax.faces.context.FacesContext facesContext)
          Suspend the include component that is currently in context.
protected  void tearDownChildrenVisitingContext(javax.faces.context.FacesContext context)
          Restores the previous values of all the EL variables maintained by this component.

 

Methods inherited from class oracle.adf.view.rich.component.fragment.UIXInclude
broadcast, createFacesBean, getAttribute, getComponentVar, getRenderedFacetsAndChildren, getVar, invokeOnComponent, queueEvent, setAttribute, setComponentVar, setVar

 

Methods inherited from class oracle.adf.view.rich.component.fragment.ContextSwitchingComponent
finishComponentEncoding, isFlatteningChildren, processDecodes, processFlattenedChildren, processUpdates, processValidators, restoreContext, setupContext

 

Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
adaptMethodBinding, addAttributeChange, addAttributeChangeListener, addClientBehavior, addFacesListener, broadcastToMethodBinding, broadcastToMethodExpression, clearInitialState, decode, decodeChildren, decodeChildrenImpl, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientBehaviors, getClientId, getContainerClientId, getDefaultEventName, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getId, getIntProperty, getLifecycleRenderer, getListenersForEventClass, getParent, getProperty, getPropertyKey, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, initialStateMarked, invokeOnChildrenComponents, invokeOnNamingContainerComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, removeAttributeChangeListener, removeFacesListener, restoreState, satisfiesPartialTrigger, saveState, setAttributeChangeListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setValueBinding, setValueExpression, subscribeToEvent, toString, unsubscribeFromEvent, updateChildren, updateChildrenImpl, validateChildren, validateChildrenImpl

 

Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponent
addPartialTarget, clearCachedClientIds, clearCachedClientIds, encodeFlattenedChild, encodeFlattenedChildren, getLogicalParent, getLogicalParent, getStateHelper, getStateHelper, isVisitable, partialEncodeVisit, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, setupChildrenEncodingContext, setupEncodingContext, setUpEncodingContext, setupVisitingContext, tearDownChildrenEncodingContext, tearDownEncodingContext, tearDownVisitingContext, visitAllChildren, visitChildren, visitChildren, visitTree, visitTree

 

Methods inherited from class javax.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, isCompositeComponent, isInView, popComponentFromEL, processEvent, pushComponentToEL, setInView

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

TYPE

public static final org.apache.myfaces.trinidad.bean.FacesBean.Type TYPE

VALUE_KEY

public static final org.apache.myfaces.trinidad.bean.PropertyKey VALUE_KEY

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

Constructor Detail

UIXPageTemplate

public UIXPageTemplate()
Construct an instance of the UIXPageTemplate.

UIXPageTemplate

protected UIXPageTemplate(java.lang.String rendererType)
Construct an instance of the UIXPageTemplate.

Method Detail

getViewId

public java.lang.String getViewId()
Gets the view ID.

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.

Overrides:
getViewId in class UIXInclude
Returns:
the view ID

setupChildrenVisitingContext

protected void setupChildrenVisitingContext(javax.faces.context.FacesContext context)
Setups EL variables including the attribute map for use by the children of this page templete.
Overrides:
setupChildrenVisitingContext in class UIXInclude

tearDownChildrenVisitingContext

protected void tearDownChildrenVisitingContext(javax.faces.context.FacesContext context)
Restores the previous values of all the EL variables maintained by this component.
Overrides:
tearDownChildrenVisitingContext in class UIXInclude

setPartialTarget

protected void setPartialTarget(javax.faces.context.FacesContext facesContext,
                                org.apache.myfaces.trinidad.context.PartialPageContext partialContext)
When asked to be PPR-ed, Page Template should PPR its parent since it renders no DOM
Overrides:
setPartialTarget in class org.apache.myfaces.trinidad.component.UIXComponent

suspendContext

public void suspendContext(javax.faces.context.FacesContext facesContext)
                    throws java.lang.IllegalStateException
Description copied from class: UIXInclude
Suspend the include component that is currently in context.
Overrides:
suspendContext in class UIXInclude
Parameters:
facesContext - the faces context
Throws:
java.lang.IllegalStateException - if the include is not currently in context

resumeContext

public void resumeContext(javax.faces.context.FacesContext facesContext)
                   throws java.lang.IllegalStateException
Description copied from class: UIXInclude
Resume the include's context that has been suspended.
Overrides:
resumeContext in class UIXInclude
Parameters:
facesContext - the faces context
Throws:
java.lang.IllegalStateException - if the include is not suspended

suspendChange

protected org.apache.myfaces.trinidad.context.SuspendCallback.SuspendResult suspendChange(org.apache.myfaces.trinidad.context.ComponentContextChange contextChange)
Description copied from class: UIXInclude
Called by the UIXInclude.suspendContext(FacesContext) method to determine how far back to suspend the application context changes.
Overrides:
suspendChange in class UIXInclude
Parameters:
contextChange - The change to consider
Returns:
How the suspension should continue

getValue

public final java.lang.Object getValue()
Gets 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.
Returns:
the new value value

setValue

public final void setValue(java.lang.Object value)
Sets 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.
Parameters:
value - the new value value

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class UIXInclude

getBeanType

protected org.apache.myfaces.trinidad.bean.FacesBean.Type getBeanType()
Overrides:
getBeanType in class UIXInclude

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 2 (11.1.2.3.0)
E17488-04


Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.