Name

<f:subView>

Synopsis

This action represents an instance of the component type registered with the type ID javax.faces.NamingContainer (by default, an instance of the javax.faces.component.UINamingContainer class).

The action creates an instance of the component class to hold all components defined in an included subview, configures it based on the action attributes and adds it as a child to the component represented by closest JSF component parent action element. For details on how to use this action, see Chapter 12.

Syntax

<f:subView id="id" [binding="componentBinding"] [rendered="true|false"]>
  JSF component action elements
</f:subView>

Attributes

Attribute name

Java type

EL expression type

Description

binding
String

VB

Must be a value binding expression for a property the component is bound to.

id
String

None

The component ID.

rendered
boolean

Any

If set to false, the component isn’t rendered and doesn’t participate in any request processing.

Example

<f:view>
  <f:subview id="header">
    <jsp:include page="header.jsp" />
  </f:subview>
  ...
  <f:subview id="footer">
    <jsp:include page="footer.jsp" />
  </f:subview>
</f:view>

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.