Name
<h:dataTable>
Synopsis
This action represents an instance of the
component
type registered with the type ID
javax.faces.HtmlDataTable
(by default, an instance
of the javax.faces.component.html.HtmlDataTable
class), combined with a renderer registered with the renderer type ID
javax.faces.Table
.
The component is rendered as an HTML <table>
element. UIColumn
child components are responsible
for rendering the table columns. The columns can hold any type of
component, including input components and command components. The
value
attribute value can be of any type, but the
primary model type is the
javax.faces.model.DataModel
class (see Appendix B). A value of type Object[]
is wrapped
automatically in an instance of ArrayDataModel
, a
java.util.List
in a
ListDataModel
, a
javax.servlet.jsp.jstl.sql.Result
in a
ResultDataModel
, a
java.sql.ResultSet
in a
ResultSetDataModel
, and any other type in a
ScalarDataModel
.
Both the data table component and its column children may be equipped
with header
and footer
facets.
The table’s header
facet is
rendered as one <th>
element (with a
colspan
attribute set to the number of children)
within a <tr>
element, and column
header
facets are rendered as
<th>
elements within a separate
<tr>
element. A
<thead>
element encloses both header
<tr>
elements. The footer
facets, if any, are rendered in a similar manner, but with
<td>
elements instead of
<th>
and a <tfoot>
element instead of the <thead>
element. CSS style classes for the header and footer cells ...
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.