Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Vaadin 8 Grid with Generic list

Nagaraj RC
6 years ago Mar 13, 2017 3:11pm

Hi i am using Vaadin 8.0.1

I am trying to make Vaadin grid common for all of my DataList
And trying to set the Generic Arraylist of Data to Grid its not showing anything to me.

Here is my Grid code.

public class VegaGrid<T> {

    private Grid<T> grid;
    private T t;
    private ArrayList<T> mParentDataList;

    public ArrayList<T> getParentDataList() {
        return mParentDataList;

    public void setParentDataList(ArrayList<T> pParentDataList) {
        this.mParentDataList = pParentDataList;
        System.out.println("size=" + pParentDataList.size());//its printing the sie as 1001
        try {
            ListDataProvider<T> ldp = new ListDataProvider<>(pParentDataList);
        } catch (Exception e) {

    public VerticalLayout createControls() {
        VerticalLayout v = new VerticalLayout();
        try {
            grid = new Grid<T>();
            grid.getColumns().stream().forEach(column -> column.setHidable(true));
        } catch (Exception e) {
        return v;

And Here i am calling the Grid by paasing Arralist of PersonData

ArrayList<PersonData> personDataList = new ArrayList<PersonData>();
            for (int i = 0; i <= 1000; i++) {
                PersonData p = new PersonData();
                p.setDob(new Date());

VegaGrid<PersonData> vegaGrid = new VegaGrid<>();
 VerticalLayout v=vegaGrid.createControls();
 vegaGrid.setParentDataList(personDataList); // Here i am Passing the ListDAta

I am getting the grid but not the data inside.
here i am attaching the screen shot

Nagaraj RC

Alexander Ley
6 years ago Mar 16, 2017 9:25am
Sangeeth S Kumar
2 years ago Jul 18, 2020 4:18pm