Interface TableRowContainer

All Superinterfaces:
com.vaadin.flow.component.HasComponentsOfType<TableRow>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, Serializable
All Known Implementing Classes:
TableBody, TableFoot, TableHead

@NullMarked public interface TableRowContainer extends com.vaadin.flow.component.HasComponentsOfType<TableRow>
A container of <tr> elements, implemented by TableHead, TableBody and TableFoot.

The WHATWG HTML specification allows nothing but rows inside those three elements, which is what HasComponentsOfType expresses: the standard add, remove, replace and bindChildren operations are all available, but only for TableRow, so an unrelated component is rejected at compile time rather than producing invalid markup. What this interface adds on top are the row factories, which create a row and attach it in one call.

Implementers must be Component instances.

Since:
25.3
  • Method Summary

    Modifier and Type
    Method
    Description
    default TableRow
    Creates a new empty row and appends it to this container.
    default List<TableRow>
    Returns the rows in this container, in document order.
    default TableRow
    insertRow(int position)
    Creates a new empty row and inserts it at the given position.

    Methods inherited from interface com.vaadin.flow.component.HasComponentsOfType

    add, add, addComponentAsFirst, addComponentAtIndex, bindChildren, getChildren, getComponentAt, getComponentCount, indexOf, remove, remove, removeAll, replace

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    bindEnabled, isEnabled, setEnabled
  • Method Details

    • getRows

      default List<TableRow> getRows()
      Returns the rows in this container, in document order. This is the typed counterpart of HasComponentsOfType.getChildren().
      Returns:
      the rows in this container.
    • addRow

      default TableRow addRow()
      Creates a new empty row and appends it to this container.
      Returns:
      the new row.
    • insertRow

      default TableRow insertRow(int position)
      Creates a new empty row and inserts it at the given position.
      Parameters:
      position - the position to insert the row at, between 0 and the number of children in this container.
      Returns:
      the new row.