83
JSF <h:dataTable> Tag
It is used to create a data table. A table that can be updated dynamically.
Tag Attributes
Attribute | Description |
---|---|
id | It is mandatory tag which is used to assign component?s id, for that message is composed. |
class | It represents CSS class for this component. |
lang | It is used to set language for this component. |
bgcolor | It is used to set background color for this table. |
binding | It is a ValueExpression linking this component to a property in a backing bean. |
bodyrows | It is a comma separated list of row indices for which a new “tbody” element should be started. |
border | It is used to set border width which is to be drawn around this table. |
captionClass | It is used for Space-separated list of CSS style class(es) that will be applied to any caption generated for this table. |
captionStyle | It is used to set CSS style for a caption of this component. This style is applied when component is rendered. |
cellpadding | It is used to define that how much space the user should leave between the border of each cell and its contents. |
cellspacing | It is used to define that how much space the user should leave between the left side of the table and the leftmost column, the top of the table and the top of the top side of the topmost row, and so on. It also specifies the amount of space to leave between the cells. |
columnClasses | It is used to set comma-delimited list of CSS style classes that will be applied to the columns of this table. |
dir | It is used for text that does not inherit directionality. Valid values are “LTR” (left-to-right) and “RTL” (right-to-left). |
first | It is a zero-relative row number of the first row to be displayed. If this property is set to zero, rendering will begin with the first row of the underlying data. |
footerClass | It contains space-separated list of CSS style class that will be applied to any footer generated for this table. |
frame | It is used to set frame. Code specifying which sides of the frame surrounding this table will be visible. Valid values are: none (no sides, default value); above (top side only); below (bottom side only); hsides (top and bottom sides only); vsides (right and left sides only); lhs (left hand side only); rhs (right hand side only); box (all four sides); and border (all four sides). |
headerClass | It is used to set header class. Space-separated list of CSS style class(es) that will be applied to any header generated for this table. |
rowClasses | It is used to set CSS class for row. Comma-delimited list of CSS style classes that will be applied to the rows of this table. |
rows | It is used to set number of rows to be displayed. Starting with the one identified by the “first” property. If this value is set to zero, all available rows in the underlying data model will be displayed. |
summary | It is used to get summary of this table’s purpose and structure, for user rendering to non-visual media such as speech and Braille. |
title | It is used to set advisory title information about markup elements generated for this component. |
JSF <h:dataTable> Tag Example
// index.xhtml
// Product.Java
// DataTable.java
Output:
Next TopicJSF Validation