Documentation
JSFToolbox

Search 

Contents

  1. Introduction
  2. Getting Started
  3. Developing Web Sites
  4. Using Components
  5. Internationalization
  6. Code View Support
  7. Design View Support
  8. Keyboard Shortcuts
  9. Tag Object Toolbars
  10. JSF Server Behaviors
  11. Property Inspectors
Selected 12. JSF Tag Reference

12. JSF Tag Reference

Contents > JSF Tag Reference > JSF Core Tags

10. JSF Core Tag Reference

Contents > JSF Core Tag Reference > f:facet

f:facet

The Facet tag registers a named facet on the component associated with the enclosing tag. A facet represents a named section within a container component. For example, you can create a header and a footer facet for a dataTable component.

Example:

<h:dataTable id="reportTable" value="#{reportBean.dailyReport}" var="item">
  <h:column>
    <f:facet name="header">
      <h:outputText value="Daily Report" />
    </f:facet>
    <h:outputText value="#{item}" />
  </h:column>
</h:dataTable>

HTML Output

<table id="reportTable">
  <thead>
    <tr><th>Daily Report</th></tr>
  </thead>
  <tbody>
    <tr><td>Item 1</td></tr>
    <tr><td>Item 2</td></tr>
    <tr><td>Item 3</td></tr>
  </tbody>
</table>

Tag Attributes

name String
Required
The name attribute sets the name of the facet to be created. Some components have facets with predefined names, such as the "header" and "footer" facets of the component associated with the h:dataTable tag.