Skip to content

Listing

A configurable grid-based list view with integrated search, filters, column definitions, pagination, and toolbar. Use it in combination with ListingBackend to wire it to a data source.

@Builder
public record Listing(
ListingType listingType,
String id,
String title,
String subtitle,
List<Trigger> triggers,
List<UserTrigger> toolbar,
List<GridContent> columns,
boolean searchable,
List<FormField> filters,
String style,
String cssClasses,
String emptyStateMessage,
Boolean searchOnEnter,
Boolean autoFocusOnSearchText,
boolean allRowsVisible,
int size,
boolean lazyLoading,
boolean lazyColumnRendering,
boolean infiniteScrolling,
boolean useButtonForDetail,
boolean columnReorderingAllowed,
int pageSize,
boolean rowsSelectionEnabled,
List<Component> header,
List<Component> footer,
boolean wrapCellContent,
boolean compact,
boolean noBorder,
boolean noRowBorder,
boolean columnBorders,
boolean rowStripes,
String vaadinGridCellBackground,
String vaadinGridCellPadding,
String gridStyle,
String detailPath,
String onRowSelectionChangedActionId,
String contentHeight)
implements Component, PageMainContent { }
PropertyTypeDefaultDescription
idStringComponent ID
titleStringList heading
subtitleStringSubheading
columnsList<GridContent>[]Column definitions
searchablebooleanfalseShows a search text input
filtersList<FormField>[]Filter form fields above the grid
pageSizeint10Rows per page
rowsSelectionEnabledbooleanfalseEnables row checkbox selection
searchOnEnterBooleantrueSearch on Enter key press
autoFocusOnSearchTextBooleantrueAuto-focus the search box
emptyStateMessageStringMessage shown when there are no results
contentHeightStringCSS height for the grid area
compactbooleanfalseCompact row density
noBorderbooleanfalseRemoves the outer border
rowStripesbooleanfalseAlternating row background colour
columnBordersbooleanfalseVertical column separators
infiniteScrollingbooleanfalseEnables infinite scroll instead of pagination
detailPathStringURL prefix for row detail navigation
toolbarList<UserTrigger>[]Toolbar action buttons
styleStringInline CSS
cssClassesStringCSS class names
@Route("/customers")
public class CustomerListing implements ComponentTreeSupplier, ListingBackend<CustomerFilters, CustomerRow> {
@Override
public Component component(HttpRequest httpRequest) {
return Listing.builder()
.title("Customers")
.searchable(true)
.pageSize(20)
.rowsSelectionEnabled(true)
.emptyStateMessage("No customers found")
.build();
}
@Override
public ListingData<CustomerRow> search(String searchText, CustomerFilters filters, Pageable pageable, HttpRequest httpRequest) {
// return data
}
}
return Listing.builder()
.title("Orders")
.column(GridColumn.builder().id("id").label("Order #").build())
.column(GridColumn.builder().id("customer").label("Customer").build())
.column(GridColumn.builder().id("total").label("Total").build())
.searchable(true)
.build();
return Listing.builder()
.title("Invoices")
.filter(FormField.builder().id("status").label("Status").dataType(FieldDataType.enumeration).build())
.filter(FormField.builder().id("dateFrom").label("From").dataType(FieldDataType.date).build())
.searchable(true)
.build();
  • If no columns are specified, Mateu infers them from the Row generic type of ListingBackend.
  • Listing is the fluent equivalent of Grid but is designed to work as a full-page component with integrated search and backend data loading.