Skip to main content

Reference

 

Applies only to Web Applications
OutSystems

Table Records Widget

Displays the records of an Entity or a Structure in a tabular layout.

Properties

Name Description Mandatory Default value Observations
Name Identifies an element in the scope where it is defined, like a screen, action, or module. Yes
Source Record List Current list of records displayed by the widget. Yes The expression used in this property (if present) is evaluated when a widget runtime property is first used (e.g. an expression using the list Length runtime property) or when the widget is rendered.
Empty Message Text displayed in the first row of the widget when there are no records to show. "No items to show..."
Line Count Maximum number of rows to display in this widget. Yes 50
Start Index Index of the first List item to iterate. Can be an expression. Yes 0 The expression used in this property (if present) is evaluated before the web screen preparation.
Width Width of the widget in columns. Other accepted units are pixels(px), points(pt), or percentage(%). Overrides the style sheet definition.
Margin Left Left margin of the widget in columns. Other accepted units are pixels(px), points(pt), or percentage(%). Overrides the style sheet definition.
Margin Top Top margin of the widget in pixels. Other accepted units are points(pt) or percentage(%). Overrides the style sheet definition.
Cell Height Height of cells in the table in pixels. Other accepted units are points(pt) or percentage(%). Overrides the style sheet definition.
Cell Spacing Space between cells in pixels. Overrides the style sheet definition.
Show Header Set as Yes to display the header row of the table. Yes Yes
Style Classes Specifies one or more style classes to apply to the widget. Separate multiple values with spaces. "TableRecords"
Header Style Specifies one or more style classes to apply to the header of the widget. Separate multiple values with spaces. "TableRecords_Header"
Odd Line Style Specifies one or more style classes to apply to the odd lines of the widget (excluding the header). Separate multiple values with spaces. "TableRecords_OddLine"
Even Line Style Specifies one or more style classes to apply to the even lines of the widget (excluding the header). Separate multiple values with spaces. "TableRecords_EvenLine"
Extended Properties
Property Name of an attribute to add to the HTML translation for this element. You can pick a property from the drop-down list or type a free text. The name of the property will not be validated by the platform.

Duplicated properties are not allowed. Spaces, " or ' are also not allowed.
Value Value of the attribute. You can type the value directly or write expressions using the Expression Editor.

If the Value is empty, the corresponding HTML tag is created as property="property". For example, the nowrap property does not require a value, therefore nowrap="nowrap" is added.

Runtime Properties

Name Description Read Only Type Observations
List Collection of records returned by the performed query. Record List
LineCount Maximum number of rows displayed in the widget as defined in the Line Count property. Yes Integer
StartIndex Index of the first record displayed in the widget as defined in the Start Index property. Yes Integer
Id Identifies the widget instance at runtime (HTML 'id' attribute). You can use it in JavaScript and Extended Properties. Yes Text

Layout of the widget

The layout of this widget follows these rules:

  • Each record of the entity or structure corresponds to one row in this widget;

  • Each attribute corresponds to one column;

  • For each attribute, there is one column with n+1 rows with the following semantics:

    First row: The name of the attribute that corresponds to the "Label" property, if any, or the name of the attribute. You can apply styles to this row, by setting the "Header style" property;

    Other rows: The value of the attribute for each record is displayed as a Expression widget and, therefore, you can use the Expression editor to modify it (they can optionally be presented using one of the input widgets to allow editing). You can have different styles in odd and even lines, by setting the "Odd Line style" and "Even Line style" properties.

Iterating the widget

The entity and/or structure records that you want to display are defined in the "Source Record List" property of this widget, which must be of the List type. Each record of this list is displayed on a different line. The first record that is displayed on the widget corresponds to the "Start Index" position on the list and the number of records displayed depends on the "Line Count" property.

To iterate over the Source Record List, you have to update the "Start Index" property for each iteration by using the "Line Count" and "Start Index" runtime properties of the Table Records widget.

Additional Notes

  • The widget "Id" runtime property is only available in the screen scope if the widget property "Name" is not empty;

  • An "Id" attribute of unnamed widgets may change at any time. For this reason, if you are using CSS or JavaScript that relies on the "Id" attribute, ensure you assign a name to the widget so that its "Id" doesn't change;

  • LineCount and StartIndex are very useful to implement the Previous and Next behaviors of a Table Records widget.

  • Was this article helpful?