A search result table control that uses the My webMethods Server search result table look-and-feel.
The Async Search Result Table control pages and sorts records (rows) using asynchronous requests. You can use the bufferChunk
, bufferMin
, bufferMax
, clientSideCache
, flashOnChange
, progressDelay
, progressMsg
, and suppressInputs
attributes to customize the table's asynchronous behavior.
For more information on the com.webmethods.caf.faces.table.AsyncTable
, see the Async Table control.
If you generate a SearchResult portlet in Composite Application Framework, the portlet preferences are generated by the application. For more information, see information about setting preferences for the Search Results portlet in the portlet preferences description in the webMethods CAF Development Help.
To provide custom content for the export, such as to get a set of columns with more machine-friendly formatted data, you can bind the Async Search Result Table control's exportProvider
property value to a separate com.webmethods.caf.faces.data.ITableContentProvider
instance. A convenient ITableContentProvider
implementation designed for CSV export is the com.webmethods.caf.faces.data.export.CSVExportProvider
class. It maps the content of an existing ITableContentProvider
(usually the provider that provides the raw data for the table) to a custom set of columns, with each column's content specified by a binding expression.
The following example demonstrates creating a CSVExportProvider
in a custom page bean method. (You would bind the property for which this method is a getter, "myExportProvider", to the Async Search Result Table control's exportProvider
property value.) It assumes that there is already an existing table content provider for the raw table data, accessible via the getMyExistingTableContentProvider()
method. It creates four columns: "ID", "Title", "Priority", and "Priority Name". Additionally, it specifies the content of these columns with binding expressions: #{row.projectId}_#{row.id}
, #{row.title}
, #{row.priorityValue}
, and #{row.priorityName}
. The name of the row variable, in this case "row", must be specified as the third argument to the CSVExportProvider
constructor.) For each row, the content of the "ID" column in the exported table will be generated from the value of the existing table row's "projectId" and "id" properties; the content of the "Title" column will be generated from the value of the existing table row's "title" property; and so on.
public ITableContentProvider getMyExportProvider() {
ITableContentProvider existingProvider = getMyExistingTableContentProvider();
Map keys = new LinkedHashMap();
keys.put("ID", createValueBinding("#{row.projectId}_#{row.id}"));
keys.put("Title", createValueBinding("#{row.title}"));
keys.put("Priority", createValueBinding("#{row.priorityValue}"));
keys.put("Priority Name", createValueBinding("#{row.priorityName}"));
return new CSVExportProvider(existingProvider, keys, "row");
}
Note that because the exported table's column labels are simply the column keys ("ID", "Title", "Priority", and "Priority Name"), it is a good practice to use string resources from a resource bundle instead of hardcoding the labels. The labels are hardcoded in this example for simplicity. Note also, that the example uses a LinkedHashMap
, which ensures that the columns will be exported in the order they were added to the keys map. The exported CSV might look like the following:
ID, Title, Priority, Priority Name
higgins_123, Nothing Works, 1, Critical
higgins_ABC, "Name should be ""MWS""", 3, Medium
The export processing handles the escaping of column values (in the example output above, the Name should be "MWS"
value is escaped as "Name should be ""MWS"""
).
Children
javax.faces.Column
, Basic Column control
Info | Value |
---|---|
Component Type | com.webmethods.caf.faces.search.AsyncSearchResultTable |
Handler Class | com.webmethods.caf.faces.component.DynamicControlHandler |
Renderer Type | com.webmethods.caf.faces.DataTable |
Description | Displays search data model as a table that pages asynchronously |
Palette Location | CAF Html/Control/Search/Async Search Result Table |
Client-Side Model | CAF.Table.Model |
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 |
bufferChunk | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
|
Chunk size in rows to use when filling client-side cache buffer (0=don't chunk)
If not specified, the default value is "0". |
bufferMax | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
|
Maximum buffer size in rows for client-side caching (0=no buffer)
If not specified, the default value is "0". |
bufferMin | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
|
Minimum buffer size in rows for client-side caching (0=no buffer)
If not specified, the default value is "0". |
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. |
clientSideCache | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to cache rows on the client
If not specified, the default value is "false". |
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:
|
displayOptions | false | javax.el.ValueExpression
(must evaluate to boolean )
|
If true, the 'Options...' button will be rendered to open search results options dialog
If not specified, the default value is "false". |
dragAndDropColumns | false | javax.el.ValueExpression
(must evaluate to boolean )
|
Allow drag-to-resize-columns and drag-to-reorder-columns.
If not specified, the default value is "false". |
exportButtonAvailable | false | javax.el.ValueExpression
(must evaluate to boolean )
|
If true, the 'Export Table..' button will be rendered in the header
If not specified, the default value is "true". |
exportCharacterEncoding | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
Character Encoding for the exported data file
If not specified, the default value is "UTF-16LE". |
exportExcludeComponentsCSV | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| CSV of Component IDs that should be excluded when exporting the table data |
exportFileName | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
The filename for the exported table data
If not specified, the default value is "export.csv". |
exportProvider | false | javax.el.ValueExpression
(must evaluate to com.webmethods.caf.faces.data.ITableContentProvider )
| Provider for exported content |
exportShowEncodingDialog | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to show the character encoding selection dialog before exporting
If not specified, the default value is "true". |
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". |
flashOnChange | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to flash rows that have changed
If not specified, the default value is "true". |
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 |
progressDelay | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
|
Milliseconds to wait before showing progress dialog
If not specified, the default value is "0". |
progressMsg | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Progress dialog message; defaults to a localized message, in English "Loading..." |
querySupplied | false | javax.el.ValueExpression
(must evaluate to javax.faces.el.ValueBinding )
|
Value binding that specifies if a search query has been supplied
If not specified, the default value is "#{empty activePageBean.activeSearchQueryString}". |
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 |
suppressInputs | false | javax.el.ValueExpression
(must evaluate to java.util.Collection )
|
Ids of controls on which to disallow update processing while handling asynchronous requests
If not specified, the default value is "false". |
title | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| HTML "title" attribute value (often displayed as a tooltip) |
value | true | javax.el.ValueExpression
(must evaluate to null )
| 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.