Skip to content

Table Content

The TableContent widget provides a tabular interface for data entry, allowing users to manage rows and columns within a table structure.

This widget is best suited for data entry tasks requiring complex rules and enhanced usability. For displaying large datasets, the more efficient DataTable widget is recommended.

Key Features

  • Support for common table operations: adding, deleting, and moving rows.
  • Expandable/collapsible editors for each row, providing additional input fields.
  • Table import/export functionality.

Data Model

The TableContent widget employs a sequence-type data model to store table rows. Each row in the table is represented by a new element within the data model, containing the row's data.

Table Columns

Tables can contain any number of columns, each of which can host one or more widgets. Column widths can be specified as percentages, along with minimum and maximum width constraints (also as percentages).

Column headers and footers support data templates, enabling the display of calculated values. Columns can also have associated validation and formatting rules applied.

Unique Row IDs

To automatically assign unique IDs to each row, specify an XPath expression using the RowIdXPath property. This expression will be evaluated for each row to generate a unique identifier.

Row Filtering

By default, all rows in the data model are displayed. To filter rows based on specific criteria, provide an XPath expression that evaluates to a boolean value in the FilterXPath property. Only rows where this expression evaluates to true will be displayed.

Table Operation Rules

The TableContent widget allows controlling table operations using XPath expressions. To disable an operation, set the corresponding XPath expression to false() or 0.

  • AllowMovingXPath: Controls whether rows can be moved. The context of the XPath expression is the table's bound XPath.
  • AllowNewXPath: Controls whether new rows can be added. The context is the table's bound XPath.
  • AllowDeleteXPath: Controls whether individual rows can be deleted. The context is the XPath of the row being considered.
  • AllowDeleteAllXPath: Controls whether all rows can be deleted at once. The context is the table's bound XPath.

Row-Specific Rules

In addition to column-level rules, row-specific rules can be defined using the RowRules property. These rules are evaluated for each row in the table.

Row Editor

Each row in the TableContent widget has an associated editor pane, which can be expanded or collapsed. This pane allows for adding additional widgets that might not fit within the main table columns due to space limitations.

Row Script

TableContent widget also has an row scripting feature to initialize rows with default values or to perform calculations based on other row values. The script is executed when a new row is added to the table.

Created new row is passed to script via $NewChild variable.

Example

The following row script assigns a row number to each new row added to the table:

1
$NewChild.SetValue('RowNumber', $Xml.Count('Rows/Row') + 1);