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]
|
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?