Transfer data from Grid to HTML-Template

Hi,

I hope someone can help me. My problem is that I am not able to transfer data from a Grid to a HTML-Table.

Here is what I want:

  • I want to use a HTML-Template that holds a (homepage.html).
  • I want to define a Grid with all the relevant data (HomepageView.java).
  • Then I want to transfer all the data from the Grid to the

  • HomepageView.java

    [code]
    public class HomepageView extends VerticalLayout implements View {

    public HomepageView() {
    
        List<Article> articleList = Arrays.asList(
                new Article("Title1", "947463746374", "9-47463-746-374"),
                new Article("Title2", "957837473474", "9-57837-473-474"),
                new Article("Title3", "957837473474", "9-57837-473-474"),
                new Article("Title4", "957837473474", "9-57837-473-474"),
        );
        
        Grid<Article> grid = new Grid<>();
        grid.setItems(articleList);
        
        grid.addColumn(Theme::getTitle).setCaption("Title");
        grid.addColumn(Theme::getEan).setCaption("Ean");
        grid.addColumn(Theme::getIsbn).setCaption("Isbn");    
        
        ???
        ???
        ???
    }
    

    }
    [/code]homepage.html[code]

    [/code]Article.java [code] public class Article {
    private String title;
    private String ean;
    private String isbn;
    
    public Article() {
    }
    
    public Article(String title, String ean, String isbn) {
        this.title = title;
        this.ean = ean;
        this.isbn = isbn;
    }
    

    }
    [/code]
    Any suggestions?

Hi, I think what you want is transfer Vaadin Grid data into another HTML base page to display, right?

  1. If you have static HTML table template page, then what you need is to using the gird.items with simple string replacement.
  2. If you want to have dynamic html table same as Grid, then you might need to use grid.columns() to build the html source in runtime.