Skip to main content

 

Traditional Web

 

Applies only to Traditional Web Apps

 

OutSystems

Table Records Widget

  • Edit
  • 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.
    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 shows as a Expression widget and, therefore, you can use the Expression editor to modify the content. You can also use the input widgets to allow editing. Set different styles in odd and even lines with Odd Line style and Even Line style properties.

    Iterating the widget

    Set the source data (entity and/or structure records) in the Source Record List property of Table Records. The data must be of the List type, and each item of the list shows on a different line. The first record that shows in the widget corresponds to the Start Index position on the list. The number of records that the table shows 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 when the widget property Name isn't empty.
    • LineCount and StartIndex are useful when you want to implement the previous/next behavior of a Table Records widget, because the parameters control how many records you show in the table and from which record number. Scaffold a screen by dragging an Entity to a web flow to get a table with pagination. You can then check out how LineCount and StartIndex work.
    • If you have an Aggregate in the Preparation that provides a list of records to Table Records and you leave empty the value Max. Records of the Aggregate, the platform calculates the value of Max. Records for you according to the following formula: Start Index of the Table Records + Line Count of the table + 1. A workaround is to set a static Line Count in the Table Records widget that's at least equal to the maximum number of records your query can retrieve.
    • Was this article helpful?