Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
12c (12.1.2)

E23188-01

<af:xmlContent>

xmlContent xml content


Allows arbitrary xml content to be included in a jsp page. This tag is to be used inside of a pageTemplateDef or a componentDef to describe the attributes, facets, and overall description of the page template or declarative component.

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

Example declarative component definition:

<?xml version='1.0' encoding='ISO-8859-1'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <jsp:directive.page contentType="text/html;charset=ISO-8859-1"/>
  <af:componentDef var="attrs" componentVar="component">
    <af:xmlContent>
      <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
        <display-name>componentDef1</display-name>
        <facet>
          <facet-name>facet1</facet-name>
        </facet>
        <attribute>
          <attribute-name>attr1</attribute-name>
          <attribute-class>java.lang.String</attribute-class>
        </attribute>
        <component-extension>
          <component-tag-namespace>component</component-tag-namespace>
          <component-taglib-uri>/componentLib1</component-taglib-uri>
          <method-attribute>
            <attribute-name>method1</attribute-name>
            <method-signature>void method(javax.faces.event.ActionEvent)</method-signature>
          </method-attribute>
        </component-extension>
      </component>
    </af:xmlContent>
    <af:panelGroupLayout layout="vertical">
      <af:facetRef facetname="facet1"/>
      <af:outputText value="#{attrs.attr1}"/>
      <af:commandButton text="Click to invoke method1" actionListener="#{component.handleMethod1}"/>
    </af:panelGroupLayout>
  </af:componentDef>
</jsp:root>