Are Java records supported in flow 24.3.3?

Not working with Vaadin 24.3.3
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

import java.util.Arrays;
import java.util.List;

public class RecordGridView extends VerticalLayout {

// Definiere ein einfaches Java-Record
public record Person(String name, int age) {}

public RecordGridView() {
    // Erstelle ein Vaadin Grid
    Grid<Person> grid = new Grid<>(Person.class);

    // Fülle das Grid mit Daten
    List<Person> people = Arrays.asList(
            new Person("Alice", 25),
            new Person("Bob", 30),
            new Person("Charlie", 22)

    // Füge das Grid zur Vaadin-View hinzu


Just define the columns yourself. Grid auto-column and BeanBinder are working based on Beans.

I know that its possible with classes. Is it possible with records?



It would be fine, if a message were written or an exception thrown.

The javadoc says “bean” tho :grimacing:

With VGrid (Viritin from add-on, since 2.6.1, currently syncing to Maven central) it works :sunglasses: flow-viritin/src/test/java/org/vaadin/firitin/ at v24 · viritin/flow-viritin · GitHub

Stop improving Viritin and improve Vaadin :joy:

This is more productive :sunglasses:


I just wanted to use Record in Grid today. If I want to do that tomorrow, this is the way. In flow-components, my PR wil be closed after two years, because there might be a better way to support records in Grid :crazy_face:).

Seriously, though, Viritin is often an inspiration for Vaadin core features. The features might not make it in as-is, but it’s great to have a prototype with real-life users before committing to a design

Yeah I understand the intention :slightly_smiling_face: I just like Matti’s contribution to the core framework :innocent: