A Table represents a two-dimensional data set arranged in rows and columns. A Table UI element is built of TableColumns. You define the content of a Table with the dataSource property, the TableColumns have TableCellEditors you have to bind to the attributes of the context node dataSource is bound to.
● accessibilityDescription
When accessibility is activated, the assigned text is added to the tooltip. This description provides semantic details of the UI element and is only read by the screen reader if the user focuses the complete Ul element.
● activateAccessKey
Indicates whether access key for this control is activated. More information: Enabling Access Keys
● compatibilityMode
This property allows application developers to adapt applications to changed behavior in a new Release. compatibilityMode is represented by enumeration type WDTableCompatibilityMode and can take the following values:
auto |
Specifies the behavior of the table according to the Release in which the application was created. |
nw04Plus |
The behavior of the table is the standard behavior for Releases after NW04. |
● dataSource
You use this property to specify the data source. To do this, you need to specify the path to the context node that provides the data.
● design
Determines the appearance of the table. The property design can take the following values and is represented by enumeration type WDTableDesign.
transparent |
Transparent cell background The value of gridMode will be ignored |
transparentWithGrid |
Transparent cell background for table. The value of gridMode will be considered. |
● displayEmptyRows
specifies whether empty rows are displayed depending on the value specified for visibleRowCount.
The screenshot below illustrates the behavior of displayEmptyRows
Number of elements = 3 visibleRowCount = 5 displayEmptyRows = true (default)
|
Number of elements = 3 visibleRowCount = 5 displayEmptyRows = false
|
|
|
● emptyTableText
Specifies the text to be displayed if the rows in the table are empty. If you do not enter a text here, a standard text will be displayed if property visibleRowCount is -1.
● firstVisibleRow
Specifies which row of the table is displayed as the first row.
● firstVisibleScrollableCol
Specifies the ID of the first horizontally scrollable column after all fixed columns.
● fixedTableLayout
Specifies whether the table obeys the layout restrictions. If this is set to true, the content of the row will be cut off if it is longer than the allowed width.
● footerVisible
Specifies whether footer is displayed.
● gridMode
Specifies if and how a border is displayed. gridMode is of enumeration type WDTableGridMode and can take the following values:
both |
|
none |
No borders are displayed |
vertical |
Only vertical borders are displayed |
horizontal |
Only horizontal borders are displayed |
The default setting is both.
● handleHotkeys
Specifies whether this Table acts as a separate container for hotkeys. If this property is set to true then all hot keys defined by UI elements within this table will be handled by this table. It defines a new scope for hot keys. By default property is set to false that means hot keys will be propagated to parent container. More information: Implementing Hot Keys
● legendId
Specifies the ID of the assigned legend.
● multiColSorting
specifies whether the option to define more than one table column as sort criteria is enabled.
● readOnly
Specifies whether or not the table can be edited. If this is set to true, the data in the table cannot be edited.
● rowSelectable
Specifies whether or not a row can be selected.
● scrollableColCount
Specifies the number of visible scrollable columns. If this is set to -1, all columns will be displayed.
● selectedPopin
Specifies the selected TablePopin.
● selectionChangeBehaviour
Changes to the lead selection can cause data loss – for example, if the changed or new data was not written to the context due to syntax errors. You can avoid this using the selectionChangeBehaviourproperty before lead selection is changed: This property is represented by enumeration type WDTableSelectionChangeBehaviour and can take the following values:
auto |
Specifies that the UI element automatically changes the lead selection after an interaction by the user before the corresponding event is triggered. |
manual |
Specifies that the UI element does not change the lead selection after an interaction by the user but triggers the corresponding event. In this case, the event handler must change the lead selection to enable the UI element to display the data. This setting allows you to check changes made to the lead selection. |
ifNoLoss |
Specifies that the lead selection only changes if all user entries are written to the context. The lead selection is then changed automatically, and the corresponding event is triggered. Otherwise, the event is triggered, but the lead selection is not changed. |
● selectionMode
Specifies
how the table rows can be selected.
Normally, the way table rows are selected Is specified by the definition of
the context node. However, you can change the selection using the selectionModeproperty. The
selectionMode property is
represented by the enumeration type WDTableSelectionMode and can take the
following values:
auto |
The selection mode is determined automatically by data binding. |
multi |
Multiple table rows can be selected if the context node allows multiple selection. |
none |
No selection possible |
single |
Only one row can be selected at a time. |
multiNoLead |
Multiple rows can be selected, a lead selection is not displayed. |
If you assign the single value to the selectionModeproperty, you can only select one row at a time, even if multiple is defined for the context node.
● visibleRowCount
Specifies the number of table rows that can be displayed without the user needing to scroll.
The value -1 is deprecated. Use displayEmptyRows = false and specify a maximum value of visible rows in visibleRowCount.
● width
Specifies the width of the table and can be specified in relative CSS units like em, ex, or percentage.
Properties Overview
Name |
Interface |
Type |
Initial Value |
Bindable |
accessibilityDescription |
IWDTable |
String |
|
bindable |
activateAccessKey |
IWDTable |
boolean |
false |
not bindable |
compatibilityMode |
IWDTable |
WDTableCompatibilityMode |
auto |
bindable |
dataSource |
IWDTable |
Object |
|
bindable_mandatory |
design |
IWDTable |
WDTableDesign |
standard |
bindable |
displayEmptyRows |
IWDTable |
boolean |
true |
bindable |
emptyTableText |
IWDTable |
String |
|
bindable |
firstVisibleRow |
IWDTable |
int |
0 |
bindable |
firstVisibleScrollableCol |
IWDTable |
String |
|
bindable |
fixedTableLayout |
IWDTable |
boolean |
false |
bindable |
footerVisible |
IWDTable |
boolean |
true |
bindable |
gridMode |
IWDTable |
WDTableGridMode |
both |
bindable |
handleHotkeys |
IWDTable |
boolean |
false |
not bindable |
legendId |
IWDTable |
String |
|
bindable |
multiColSorting |
IWDTable |
boolean |
false |
bindable |
readOnly |
IWDTable |
boolean |
false |
bindable |
rowSelectable |
IWDTable |
boolean |
true |
bindable |
scrollableColCount |
IWDTable |
int |
-1 |
bindable |
selectedPopin |
IWDTable |
String |
|
bindable |
selectionChangeBehaviour |
IWDTable |
WDTableSelectionChangeBehaviour |
auto |
not_bindable |
selectionMode |
IWDTable |
WDTableSelectionMode |
auto |
bindable |
visibleRowCount |
IWDTable |
int |
5 |
bindable |
width |
IWDTable |
String |
|
bindable |
See also: Common UI Element Properties
● onColSelect (String col)
This event is triggered if the user clicks a table column header. The parameter is the selected column.
● onFilter
Event on Filter is triggered if filter symbol is selected in the first table column.
● onLeadSelect (String col, String newRowElement, String oldRowElement, int row)
Event onLeadSelect is triggered if lead selection for the table changes. The parameters are are:
○ col: The ID of the selected column.
○ newRowElement: The path to the node element representing the selected row (i.e. the one the user has just chosen). Note that, depending on the table's selection change behavior, this might not yet be the element at the data source's current lead selection. This parameter replaces the index based "row" parameter for hierarchical tables where a row cannot be adequately represented by an index, but only by its associated node element. Nevertheless it can--and should--be used for "flat" tables, too.
○ oldRowElement: The path to the node element representing the selected row (i.e. the one that was selected before the user's interaction). Note that, depending on the table's selection change behavior, this might still be the element at the data source's current lead selection.
○ row
The zero based index of the selected row (i.e. the one the user has just chosen). Note that, depending on the table's selection change behavior, this might not yet be the data source's current lead selection.
This parameter is replaced by the String based "newRowElement" parameter for hierarchical tables where a row cannot be adequately represented by an index, but only by its associated node element. In general, it is deprecated and should be avoided in future development.
● onSort (String col, WDTableColumnSortDirection direction, boolean multiple)
Event onSort is triggered if the user clicks the sort icon in a column header.
Parameters are:
○ col: The ID of the column to be sorted.
○ direction: The direction in which the sorting has been requested.
○ multiple: Indicates whether the supplied column should be sorted additional to the previously existing sorting.
The sort status of a column is automatically displayed in the column in question:
Unsorted |
|
Ascending |
|
Descending |
|
● onDrop(String data, String mimeType, int offset, String rowElement, String tags)
This event is triggered when the user drops an object onto this Table. The parameters are:
○ data: The data specified for the drag source.
○ mimeType: the mime type specified for the drag source.
○ offset: the position relative to the rowElement, the user has dropped the object onto.
■ -1: just above the item specified by rowElement
■ 0: right onto the item specified by rowElement
■ +1: just below the item specified by rowElement.
○ rowElement: That row is described by a path to the node element representing it. Declare an action and event handler parameter of type IWDNodeElement (or one of your own node element classes) along with a suitable parameter mapping; then the path will be automatically transformed into a node element instance.
Note: when the table is empty at the time of the drop, the offset will be 0 and the rowElement will be NULL
○ tags: the tags defined for the drag source