Table

The Table widget provides the ability to display data in a table.

The Table widget also supports pagination. A paginated table is a table widget that displays data elements from the backend system on different pages in a table. A paginated table can be used when the number of elements are both known or unknown, and it can be defined by functional developers without having to develop a pagination operation for every table. One type of pagination operation corresponds to one specific scenario. Table pagination also supports the scenario in which the content of the first page has already been retrieved by an initial operation and the pagination operation should not be called when loading the table widget.

Implementation base

The Table widget is a Dojo-based widget:
  • com.ibm.btt.dijit.Grid

Properties

The properties described in Table 1 can be configured for the Table widget.
Table 1. Properties that can be configured for the Table widget
Property Description
dataName The dataName property specifies the name of the data element that is used to cache the record in the table that is submitted.
dataNameForList The dataNameForList property specifies the name of the data, from a WebSphere® Multichannel Bank Transformation Toolkit context or a JSON string, that contains the records for the table.
isPageable The isPageable property specifies whether the table is single page table or pageable table. The default value is false.
columnReordering The columnReordering property specifies whether the order in which the columns of the table are displayed can be changed by a user. The default value is false.
width The width property specifies the width of the widget. The default value is 80 pixels.
height The height property specifies the height of the widget. The default value is 300 pixels.
operationNameForPagination The operationNameForPagination property specifies the server-side operation that sort and separate the data records for display on the GUI.
sortEnabled The sortEnabled property specifies whether the rows on the table can be sorted by a user.
selectionMode The selectionMode property specifies the number of rows that can be selected by a user. Values that can be specified for the selectionMode property are none, single, and multiple.
selectionRequired The selectionRequired property specifies whether a user is required to select a record. If the selectionRequired property is set to true and the user does not select a record, an error message displays.
readOnly The readOnly property is an expert-level property, which means that it is available for use in the XUI editor only if the XUI editor is configured to display expert properties. If you select a value of true for the readOnly property, the widget is displayed on a GUI but a user cannot interact with it. If a widget has the value of its readOnly property set to true and the value of its disabled property set to false, the data of the widget is taken into account during form submission. The default value for the readOnly property is false.
Note: To ensure that the Table widget and all the widgets contained in the Table widget are read-only, you must both set the value of the readOnly property to true and select the Editable check box in the Details panel of the Columns tab, which is in the Table view of the Properties tab. If you do not select the Editable check box, the widgets that are contained in the Table widget can be edited by a user.
Each column in a table has the properties described in Table 2.
Table 2. Properties of the columns in a Table widget
Property Description
text The text property specifies the text that is displayed as the header of the column.
dataName The dataName property is the name of the data element to which the column is bound.
width The width property specifies the width of the column.
editable The editable property specifies whether the cells in the table can be edited by a user. If a value of false is specified for the editable property, the cell is displayed but cannot be edited.
alignment The alignment property specifies the alignment of the text in the cells of the table. Three values are available for the alignment property:
  • Left
  • Center
  • Right
The default value is Left.
Widget The options that are available for selection for the Widget property are different depending on whether true or false is selected for the editable property. If the editable property is set to true, the items that are available for the Widget list are editable such as TexBox. If the editable property is set to false, the items that are available on the Widget list are non-editable such as Image.
If a value of true has been selected for the isPageable property, the properties described in Table 3 can be configured in the Pagination tab of the Properties view.
Table 3. Properties that can be configured for the paginated table widget
Property Description
operationNameForPagination The operationNameForPagination property specifies the technical operation name for the pagination table.
directPagination The directPagination property specifies whether the number of pagination table rows is known. The default value is false.
paginationType The paginationType property specifies the pagination type that is registered in the btt.xml file. Default value is default.
RowsPerPage The RowsPerPage property specifies the number of rows for each page in pagination table. The default value is 25.
timeout The timeout property specifies the length of time after which an AJAX request times out in a pagination table. Default is 500 milliseconds.
paginationWhenLoading The paginationWhenLoading property specifies pagination or not when first loading the page. The default value is false.
initialInputMapping The initialInputMapping property specifies the initial page input mapping. This property is enabled when a value of true is specified for the paginationWhenLoading property.
nextInputMapping The nextInputMapping property specifies the next page input mapping. This property is enabled when a value of false is specified for the directPagination property.
previousInputMapping The previousInputMapping property specifies the previous page input mapping. This property is enabled when a value of false is specified for the directPagination property.
directInputMapping The directInputMapping property specifies the direct page input mapping. This property is enabled when a value of true is specified for the directPagination property.
normalOutputMapping The normalOutputMapping property specifies the normal response output mapping
errorOutputMapping The errorOutputMapping property specifies the error response output mapping.

Data mapping

The data that is specified in the dataNameForList property must be an IndexedCollection from the WebSphere Multichannel Bank Transformation Toolkit context hierarchy.

The inner data element can be either an IndexedCollection or a KeyedCollection. If the inner data element is a KeyedCollection, the values from each element that are contained in the KeyedCollection are displayed on a row of the table. If the inner data element is an IndexedCollection, the values of the elements that are contained in the IndexedCollection are displayed on a column.

The dataName property specifies the name of a data element that is retrieved from a WebSphere Multichannel Bank Transformation Toolkit context. Data that are entered into the rows of a table are submitted to the data element specified in the dataName property. The data element can be either an IndexedCollection or a KeyedCollection. If single is selected for the selectionMode property, the data element should be a KeyedCollection. If multiple is selected for the selectionMode property, the data element should be an IndexedCollection.

Sometimes, the application requires that the table widget be bound with special data items on each row. When the table data is downloaded from the server side, the special data items are loaded with other table data, and the special data items are sent back to the server side when the selected rows are submitted. The difference between the special data items and normal table data is that the special data items are not displayed on the table widget; therefore, special data items are called "hidden columns" here. For example, the "hidden columns" may be the key identifier of the rows, which are not displayed on the view but are required for the identification of the selected rows. The data field that corresponds to a "hidden column" must meet the following three conditions:
  • The data field exists in the keyed collection or indexed collection that is specified in the dataName property.
  • The data field exists in the indexed collection that is specified in the dataNameForList property.
  • The data field is not a explicitly declared column.
The WebSphere Multichannel Bank Transformation Toolkit runtime will handle the data field as a "hidden column" for the table and send the field data to the table widget. The table widget retains the data and then posts it to the server with the selected rows.
For a paginated table, specify following data in the context of a pagination technical operation:
<kColl id="pageRetrieverData" dynamic="false">
		<field id="start" value="0"/>
		<field id="count" value="15"/>
		<field id="totalRowNumber" value="101"/>
		<field id="enableNext" value="true"/>
		<field id="enablePrevious" value="false"/>
		<field id="errMsg"/>
		<field id="sort"/>
		<field id="rowsPerPage" value="25"/>
		<field id="pageNumber" value="1"/>
		<field id="pageEvent"/>
		<kColl id="queryConditions" dynamic="false">
			<field id="aFilter" value="%"/>
			<field id="bFilter" value="0"/>
		</kColl>
		<refData refId="item"/>
		<iColl id="items">
			<refData refId="item"/>
		</iColl>
	</kColl>
<!—the inner data in KeyedCollection item are the data column for the pagination table.-->
<kColl id="item">
		<field id="index" value="1"/>
		<field id="gender" value="male"/>
		… 

</kColl>
You need to specify the related data for each pagination table in the business flow. All the data in the paginationData KeyedCollection should contain the ID of the paginated table as a prefix for the data name; for example, if a paginated table has table01 as its ID, table01_ should be used as a prefix as shown in the following code block:
<kColl id="paginationData">
		<field id="table01_totalRowNumber" value="100"/>
		<field id="table01_enableNext" value="true"/>
		<field id="table01_enablePrevious" value="true"/>
		<field id="table01_errMsg" value="no msg"/>
		<field id="table01_rowsPerPage" value="15"/>
		<field id="table01_pageEvent"/>
		<field id="table01_pageNumber" value="1"/>
</kColl>
The following six mappings are available for pagination data:
initialInputMapping
The initialInputMapping property specifies the initial page input mapping. This property is enabled when a true is specified for the paginationWhenLoading property. User needs to mapping the table data from flow to table technical operation.
nextInputMapping
The nextInputMapping property specifies the next page input mapping. This property is enabled when set false is specified for the directPagination property. User need to mapping the table data from flow to table technical operation. It is called when the Next button in a paginated table is clicked and the number of pages for the paginated table is unknown.
previousInputMapping
The previousInputMapping property specifies the previous page input mapping. This property is enabled when false is specified for the directPagination property. User need to mapping the table data from flow to table technical operation. It is called when the Preview button in a paginated table is clicked and the number of pages for the paginated table is unknown.
directInputMapping
The directInputMapping property specifies the direct page input mapping. This property is enabled when set true is specified for the directPagination property. User need to mapping the table data from flow to table technical operation. It will be called when a page number in a paginated table is clicked and when table page is known.
normalOutputMapping
The normalOutputMapping property specifies the normal response output mapping. User need to mapping the table data from table technical operation to flow.
errorOutputMapping
The errorOutputMapping property specifies the error response output mapping. User need to mapping the table data from table technical operation to flow.
After the XUI file with the table pagination definition is saved, table technical general pagination operation is automatically generated.

ECA editor support

The following events, properties, and functions can be configured for the Table widget with the ECA editor.
Table 4. Events that can be added to a Table widget by using the ECA editor.
Event Description
onClick Is fired when the left mouse button is clicked.
onFocus Is fired when the widget receives focus because the user moves the mouse pointer over the widget.
onBlur Is fired when the widget does not receive focus, or when the user clicks outside the widget, or when the widget is hidden.
onKeyDown Is fired when a keyboard key is pressed.
onKeyUp Is fired when a keyboard key is released.
onKeyPress Is fired when a keyboard key is pressed or held down.
onMouseDown Is fired when a mouse button is clicked.
onMouseUp Is fired when a mouse button is released
onMouseEnter Is fired when the mouse pointer moves over the widget.
onMouseLeave Is fired when the mouse pointer moves out of the widget.
onMouseMove Is fired when the mouse pointer moves over nodes that are contained in the widget.
onSelected Is fired when a row on the table is selected.
Table 5. Properties that can be configured for the Table widget by using the ECA editor.
Property Description
styleClass The styleClass property specifies the class selector that is associated with the widget. If you do not configure the styleClass property, the default class selector is used instead.
visibility The visibility property defines how a widget is displayed on a GUI. The following values can be specified for this property:
readOnly The readOnly property is an expert-level property, which means that it is available for use in the XUI editor only if the XUI editor is configured to display expert properties. If you select a value of true for the readOnly property, the widget is displayed on a GUI but a user cannot interact with it. If a widget has the value of its readOnly property set to true and the value of its disabled property set to false, the data of the widget is taken into account during form submission. The default value for the readOnly property is false.
hint The hint is a description of the widget that is displayed as a tooltip for a user. The hint property has multilingual support.
Table 6. Functions that can be configured for the Table widget by using the ECA editor.
Function Description
focusOn() Enables a table to receive focus. The last cell of the table will receive focus.
getValueInFirstSelectedItem(attName) Retrieves the value of a column from the data element that is specified in the dataName property.
getValueInSelectedItem(itemId) Retrieves the value of a cell on a selected row.
Note: This function is not supported for WebSphere Multichannel Bank Transformation Toolkit V7.1.
getLengthSelectedRows() Retrieves the value of a row from the data element that is specified in the dataName property.