A table whose content comes from a javax.faces.model.DataModel
object, or a com.webmethods.caf.faces.data.ITableContentProvider
object. Standard list-like containers, such as java.util.List
are wrapped automatically as an ITableContentProvider
. The following containers are wrapped automatically:
java.lang.Object
arrayjava.util.List
javax.sql.rowset.CachedRowset
Each item in the list is mapped to a row in the table. Columns are configured by adding Basic Column controls as children.
To enable restful paging, you must set the tables's firstParamName
property to the name of the request parameter from which the table derives its first
property. For example, if the table binds the myFirst request parameter, where an example url is '/myTable?myFirst=10' to its first
property, using a value binding expression #{param.myFirst}
, you would set the value of the table's firstParamName
property to "myFirst". Note that in order to bind the value of a request parameter to the table's first
property, you must manually convert the request parameter value to a primitive int. You do not need to contain the table in a command Form to do restful paging.
To enable restful page sizing, you must set the tables's rowsParamName
property to the name of the request parameter from which the table derives its rows
property. For example, if the table binds the myRows request parameter, where an example url is '/myTable?myRows=10' to its rows
property, you would set the value of the table's rowsParamName
property to "myRows". To bind the value of a request parameter to the table's rows
property, you must manually convert the request parameter value to a primitive int (see the following getMyRows()
method). You do not need to contain the table in a command Form to do restful page sizing.
To enable "restful" sorting, you must set the tables's sortParamName
property to the name of the request parameter from which the table derives its sort
property. For example, if the table binds the mySort request parameter, where an example url is '/myTable?mySort=name-,description+' to the ordinals
and ascending
properties of its contained columns, you would set the value of the table's sortParamName
property to "mySort". Note that in order to bind the value of a request parameter to the table's sort
property, you must manually convert the request parameter value to an ISortInfo object (see the following getMySort()
method). You do not need to contain the table in a command Form to do restful page sizing.
// Convert "myFirst" request parameter to a primitive int.
public int getMyFirst() {
FacesContext context = FacesContext.getCurrentInstance();
String s = (String)
context.getExternalContext().getRequestParameterMap().get("myFirst");
if (s != null)
return Integer.parseInt(s);
return 0;
}
// Convert "myRows" request parameter to a primitive int.
public int getMyRows() {
FacesContext context = FacesContext.getCurrentInstance();
String s = (String)
context.getExternalContext().getRequestParameterMap().get("myRows");
if (s != null)
return Integer.parseInt(s);
return 10;
}
// Convert "mySort" request parameter to structured ISortInfo data.
public ISortInfo getMySort() {
FacesContext context = FacesContext.getCurrentInstance();
String s = (String)
context.getExternalContext().getRequestParameterMap().get("mySort");
return (s != null ? new SortInfo(s) : new SortInfo());
}
Info | Value |
---|---|
Component Type | com.webmethods.caf.faces.table.DataTable |
Handler Class | com.webmethods.caf.faces.component.DynamicControlHandler |
Renderer Type | com.webmethods.caf.faces.DataTable |
Description | Displays data model as a table |
Palette Location | CAF Html/Control/Table/Table |
Client-Side Model | CAF.Table.Model |
Name | Description |
---|---|
caption | Table caption |
header | Table header |
footer | Table footer |
empty | Empty message content |
Name | Required | Type | Description |
---|---|---|---|
bgcolor | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The background color for all table cells |
border | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Specifies the size of the border around the table. If the value is 0 or absent, no border is rendered |
cellpadding | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Specifies the spacing between data in a table cell and the border of the cell. |
cellspacing | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Specifies the spacing between table cells. |
columnClasses | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| A comma separated list of CSS classes for the table body <td> elements. |
customRowClass | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Binding expression that specifies a custom CSS class name to add to the current row |
dir | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
Specifies the directionality of the flow of the content for the current element
Valid values are:
|
filter | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Filter expression |
filterParamName | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Name of request parameter that specifies table's filter expression |
first | true | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
|
Index of first item in model to display (zero-based)
If not specified, the default value is "0". |
firstParamName | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Name of request parameter that specifies table's first row |
fixedHeight | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True if the table should have a fixed height, based on the number of rows-per-page
If not specified, the default value is "false". |
footerClass | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The CSS class for footer cells |
frame | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
Specifies the sides of the outer table border for which to draw borders.
Valid values are:
|
headerClass | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The CSS class for header cells |
id | false | java.lang.String | Control identifier |
lang | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Specifies the language of the enclosed content |
maxOrdinal | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Maximum number of sort ordinals allowed (1=primary only, 2=primary and secondary only, etc.) |
onclick | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onclick" event handler |
ondblclick | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "ondblclick" event handler |
onkeydown | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onkeydown" event handler |
onkeypress | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onkeypress" event handler |
onkeyup | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onkeyup" event handler |
onmousedown | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmousedown" event handler |
onmousemove | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmousemove" event handler |
onmouseout | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmouseout" event handler |
onmouseover | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmouseover" event handler |
onmouseup | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| JavaScript "onmouseup" event handler |
rendered | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to render control; false to ignore it
If not specified, the default value is "true". |
rowClasses | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| A comma separated list of CSS classes for the table rows. The classes are used for the <tr> elements in the order they are listed, repeating the list over all rows in the table. |
rowHeight | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Row height in pixels (ex '20px') or ems (ex '2em') |
rows | true | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Number of rows to display per page |
rowsParamName | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Name of request parameter that specifies number of rows for the table to display |
rules | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
Specifies the interior dividing line display in a table.
Valid values are:
|
selectedRowClass | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| CSS class name for selected rows |
sortParamName | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Name of request parameter that specifies table's sort info |
style | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| HTML "style" attribute value |
styleClass | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
HTML "class" attribute value
Valid values are:
|
summary | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Aids accessibility for non-visual browsers by providing a summary of the table's purpose and structure |
title | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| HTML "title" attribute value (often displayed as a tooltip) |
value | true | java.lang.String | Data model |
var | true | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Name of variable reference to the current row object |
width | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Specifies the table width in pixels or a percentage of the available width |
Output generated by Vdldoc View Declaration Language Documentation Generator.