Fluent builder for a TableViewMeta, used to assemble a table's paginator, records, columns and CSS classes step by step in a template or controller before calling build. Normally obtained from Formatter's newTable helper rather than constructed directly.

Group: Builders


Properties

PropertyReturnsDescription
classesList<String>The CSS classes added so far for the table element.
columnsList<ColumnMetaBuilder>The column builders added so far, in the order they were added.
idStringIdentifier for the table this builder will produce.
paginatorPaginatorThe paginator currently set on this builder.
recordsListThe records currently set on this builder.
titleStringThe title set on this builder.

Methods

bodyId(String s) · title(String s) · paginator(Paginator p) · records(List records) · selection(boolean b) · column(String id) · addClass(String s) · addClasses(String ss) · getId() · getTitle() · getPaginator() · getRecords() · getColumns() · getClasses() · build()

bodyId(String s)

Returns: TableViewMetaBuilder

Sets the HTML id to render on the table body element.

ParameterDescription
sthe body element id

title(String s)

Returns: TableViewMetaBuilder

Sets the table's title. This is stored on the builder but is not currently carried through to the built TableViewMeta.

ParameterDescription
sthe table title

paginator(Paginator p)

Returns: TableViewMetaBuilder

Sets the paginator describing the current page of records and how to navigate other pages.

ParameterDescription
pthe paginator to use, may be null for an unpaged table

records(List records)

Returns: TableViewMetaBuilder

Sets the rows to render for the current page of the table.

ParameterDescription
recordsthe records for this page

selection(boolean b)

Returns: TableViewMetaBuilder

Sets whether the table renders a selection checkbox column.

ParameterDescription
btrue to enable row selection

column(String id)

Returns: ColumnMetaBuilder

Adds a new column to the table and returns its builder, so column properties such as title and sortable can be chained off the call.

ParameterDescription
idthe column id, used to correlate it with a value on each record

addClass(String s)

Returns: TableViewMetaBuilder

Adds a single CSS class to render on the table element.

ParameterDescription
sthe CSS class name to add

addClasses(String ss)

Returns: TableViewMetaBuilder

Adds one or more CSS classes to render on the table element.

ParameterDescription
ssthe CSS class names to add

getId()

Returns: String

Identifier for the table this builder will produce.

getTitle()

Returns: String

The title set on this builder.

getPaginator()

Returns: Paginator

The paginator currently set on this builder.

getRecords()

Returns: List

The records currently set on this builder.

getColumns()

Returns: List<ColumnMetaBuilder>

The column builders added so far, in the order they were added.

getClasses()

Returns: List<String>

The CSS classes added so far for the table element.

build()

Returns: TableViewMeta

Builds the immutable TableViewMeta from this builder's current state, building each added column in turn and dropping any column marked not visible.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.