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;
@Route(“record-grid”)
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)
);
grid.setItems(people);
// Füge das Grid zur Vaadin-View hinzu
add(grid);
}
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 ).
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