| |
|
|
|
 |
Home NewsBlogProducts Download Buy Now Documentation Support |
 |
 |
|
|
 |
| |


Contents
|
10. Tomahawk Tag Reference
Contents > Tomahawk Tag Reference > t:dataTable
t:dataTable |
|
The t:dataTable tag is an extension to the JSF data table tag but with added features. In particular, it introduces the following attributes: preserveDataModel, preserveSort, sortAscending and sortColumn. These attributes add performance and column sorting enhancements to the data table component.
Example
<t:dataTable></t:dataTable>
|
Tag Attributes
| align |
Text |
| |
| The align attribute is a standard HTML attribute that specifies this element's horizontal alignment. |
| bgcolor |
Color |
| |
| The bgcolor attribute sets the background color for the table. This value can be the name or the hexadecimal value of the color. |
| binding |
Expression |
| |
| The value-binding expression linking this component tag to a backing bean property. |
| border |
Text |
| |
| The border attribute sets the pixel width of the border to be drawn around the table. |
| cellpadding |
Text |
| |
| The cellpadding attribute sets the width between the border of each cell and its contents. |
| cellspacing |
Text |
| |
| The cellspacing attribute sets the width of the space between the outside and inside edges of the table as well as the space between cells. |
| columnClasses |
CSS Style |
| |
The columnClasses attribute accepts a comma-delimited list of CSS style classes that will be applied to the columns of the table. Style classes for an individual column may also be defined in a space separated list. A style class is applied to a table column as the value for the class attribute of rendered td or th element.
The algorithm used to apply the CSS style classes to the table columns is simple. In the table rendering process, style classes are applied to columns one at a time until (a) there are no more columns to display or (b) there are no more style classes to apply.
- If (a) happens at the same time as (b), the next row in the table is rendered.
- If (a) happens before (b), the remaining style classes are ignored.
- If (b) happens before (a), the remaining columns will not have style classes.
|
| datafld |
Text |
| |
| The W3C has reserved the datafld attribute for future use. |
| datasrc |
Text |
| |
| The W3C has reserved the datasrc attribute for future use. |
| dir |
Enumerated |
| |
| The dir attribute is a standard HTML attribute that overrides the default text directionality for this component. The values accepted for this component are "LTR" (left-to-right) and "RTL" (right-to-left). |
| enabledOnUserRole |
Text |
| |
| The enabledOnUserRole attribute determines if this component will be rendered normally or not depending on the user's roles. |
| first |
Text |
| |
| The first attribute defines the starting index of the collection associated with this data tag. The default value is 0. |
| forceId |
Boolean |
| |
| The forceId attribute expects a boolean value, that when set to true, forces the tag to render its ID exactly as specified in the ID attribute. This allows you to apply CSS styles to the tag and to reference it in JavaScript by ID, which is typically not possible using the default JSF component ID naming system. This attribute is false by default. |
| forceIdIndex |
Text |
| |
| The forceIdIndex attribute effects the component ID name when this component is rendered at runtime. It expects a boolean value that, when true, causes the component to display an index number in its ID value if the component is in a list. It has a default value of true. |
| frame |
Text |
| |
The frame attribute sets the code specifying which sides of the frame around this table will be visible. The valid values for this attribute 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)
|
| id |
Text |
| |
| The unique identifier value for this component. The value must be unique within the closest naming container. |
| lang |
Text |
| |
| The lang attribute is a standard HTML attribute that sets the code describing the language to be used in the markup generated by this component. |
| newspaperColumns |
Text |
| |
| The newspaperColumns attribute specifies the number of columns used to wrap the contents of this table component. |
| onclick |
Text |
| |
| The onclick attribute sets the JavaScript code to execute when the mouse pointer is clicked over this element. |
| ondblclick |
Text |
| |
| The ondblclick attribute sets the JavaScript code to execute when the mouse pointer is double-clicked over this element. |
| onkeydown |
Text |
| |
| The onkeydown attribute sets the JavaScript code to execute when a key is pressed down over this element. |
| onkeypress |
Text |
| |
| The onkeypress attribute sets the JavaScript code to execute when a key is pressed and released over this element. |
| onkeyup |
Text |
| |
| The onkeyup attribute sets the JavaScript code to execute when a key is released over this element. |
| onmousedown |
Text |
| |
| The onmousedown attribute sets the JavaScript code to execute when the mouse pointer is pressed down over this element. |
| onmousemove |
Text |
| |
| The onmousemove attribute sets the JavaScript code to execute when the mouse pointer is moved within this element. |
| onmouseout |
Text |
| |
| The onmouseout attribute sets the JavaScript code to execute when the mouse pointer is moved away from this element. |
| onmouseover |
Text |
| |
| The onmouseover attribute sets the JavaScript code to execute when the mouse pointer is moved onto this element. |
| onmouseup |
Text |
| |
| The onmouseup attribute sets the JavaScript code to execute when the mouse button is released over this element. |
| preserveDataModel |
Boolean |
| |
| The preserveDataModel attribute determines whether or not the state of the dataModel should be preserved. Each time the page is rendered, the value-bindings for the "value" attribue of the dataTable will be proccessed. When set to true,the value-binding only occurs the first time the page is rendered. The dataModel is then saved and restored automatically by the component. When column sorting is used for this table, this attribute is required to be false to reflect any changes as result of sorting. The default setting is false. |
| preserveRowStates |
Boolean |
| |
| The preserveRowStates attribute determines whether or not the state of each row should be maintained or removed after each page render. A useful scenario for this setting to be true is if a input binding within the table has no value-binding. If the table is displayed later, the state would be maintained. When column sorting is used for this table, this attribute is required to be false to reflect any changes as result of sorting. The default setting is false. |
| preserveSort |
Boolean |
| |
| The preserveSort attribute expects a boolean value that, when true, causes the values of the sortColumn and sortAscending attributes to be preserved between JSF requests. |
| previousRowDataVar |
Text |
| |
| The previousRowDataVar attribute specifies a request attribute name for the variable storing the previous row object. |
| rendered |
Boolean |
| |
| A value-binding expression that evaluates to a Boolean condition indicating if this component should be rendered. |
| renderedIfEmpty |
Boolean |
| |
| The renderedIfEmpty attribute expects a boolean value that, when true, causes this table to be rendered even when the data model is empty. It is more efficient than setting the rendered attribute with a #{not empty bean.model} style JSF expression to determine rendering. The default value is true. |
| rowClasses |
CSS Style |
| |
The rowClasses attribute accepts a comma-delimited list of CSS style classes to be applied to the rows of the table.
Style classes for an individual row may also be defined in a space separated list. A style class is applied to a table row as the value for the class attribute of rendered tr element.
Style classes are applied to rows in the same order that they are defined. For example, if there are two style classes, the first is applied to the first row, the second is applied to the second row, the first is applied to the third row, the second is applied to the fourth row, and so on. The list of styles is looped over from the beginning until there are no more rows to display.
|
| rowCountVar |
Text |
| |
| The rowCountVar attribute specifies a request attribute name for the variable storing the row count value. |
| rowGroupStyle |
CSS Style |
| |
| The rowGroupStyle attribute defines the CSS style applied to grouped rows in this table. |
| rowGroupStyleClass |
CSS Class |
| |
| The rowGroupStyleClass attribute defines the CSS class applied to grouped rows in this table. |
| rowId |
Text |
| |
| The rowId attribute defines the ID to use for rows in this table. |
| rowIndexVar |
Text |
| |
| The rowIndexVar attribute specifies a request attribute name for the variable storing the row index value. |
| rowOnClick |
Text |
| |
| The rowOnClick attribute produces inline Javascript rowOnClick handler for each table row. |
| rowOnDblClick |
Text |
| |
| The rowOnDblClick attribute produces inline Javascript rowOnDblClick handler for each table row. |
| rowOnKeyDown |
Text |
| |
| The rowOnKeyDown attribute produces inline Javascript rowOnKeyDown handler for each table row. |
| rowOnKeyPress |
Text |
| |
| The rowOnKeyPress attribute produces inline Javascript rowOnKeyPress handler for each table row. |
| rowOnKeyUp |
Text |
| |
| The rowOnKeyUp attribute produces inline Javascript rowOnKeyUp handler for each table row. |
| rowOnMouseDown |
Text |
| |
| The rowOnMouseDown attribute produces inline Javascript rowOnMouseDown handler for each table row. |
| rowOnMouseMove |
Text |
| |
| The rowOnMouseMove attribute produces inline Javascript rowOnMouseMove handler for each table row. |
| rowOnMouseOut |
Text |
| |
| The rowOnMouseOut attribute produces inline Javascript rowOnMouseOut handler for each table row. |
| rowOnMouseOver |
Text |
| |
| The rowOnMouseOver attribute produces inline Javascript rowOnMouseOverhandler for each table row. |
| rowOnMouseUp |
Text |
| |
| The rowOnMouseUp attribute defines the JavaScript to execute when the user releases the mouse over this row. |
| rowStyle |
CSS Style |
| |
| The rowStyle attribute declares a HTML style attribute for each HTML row ( | tag) in the table.
| rowStyleClass |
CSS Class |
| |
| The rowStyleClass attribute assigns a CSS style class for each HTML row ( | tag) in the table.
| rows |
Text |
| |
| The rows attribute sets the number of rows to display, starting from the row identified by the "first" attribute. If the value of the rows attribute is set to zero, all available rows in the underlying data model will be displayed. |
| rules |
Text |
| |
The rules attribute specifies which lines will appear between cells in the table. The valid values for this attribute are:
- none (no rules, default value)
- groups (between row groups)
- rows (between rows only)
- cols (between columns only)
- and all (between all rows and columns)
|
| sortAscending |
Boolean |
| |
| The sortAscending attribute determines how the model associated with the table should be sorted. If true, then the value associated with this table s |
| sortColumn |
Text |
| |
| The sortColumn attribute defines the name of the column to be used for sorting data in this table. |
| sortable |
Boolean |
| |
| The sortable attribute expects a boolean value that, when true, enables column sorting for this component. |
| sortedColumnVar |
Text |
| |
| The sortedColumnVar attribute defines the name of the request attribute storing a boolean value indicating if the current column is sorted or not. |
| style |
CSS Style |
| |
| The style attribute sets the CSS style definition to be applied to this component when it is rendered. |
| styleClass |
CSS Class |
| |
| The styleClass attribute sets the CSS class to apply to this component when it is rendered. |
| summary |
Text |
| |
| The summary attribute describes the purpose and structure of the table for accessibility support for assistive devices and non-visual user agents. |
| title |
Text |
| |
| The title attribute is a standard HTML attribute that sets the tooltip text to display for the rendered component. |
| value |
Text |
| |
| The value attribute sets the current value for this component. |
| var |
Text |
| Required |
| The var attribute sets the name of a request-scope attribute exposing the data for each iteration over the rows in the underlying data model for this table. |
| varDetailToggler |
Text |
| |
| The varDetailToggler attribute defines the name for an object that has a boolean property and an action method associated with it. The boolean property named "currentdetailExpanded" is true if the current detail row is expanded, and the action method "toggleDetail" expands and collapses the current detail row. |
| visibleOnUserRole |
Text |
| |
| The visibleOnUserRole attribute determines if this component will be visible or not depending on the user's roles. |
| width |
Text |
| |
| The width attribute specifies the width of this component. |
|
|
|
| |
|