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.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Empty Grid in 8.0.2
Hi folks,
I am really excited to upgrade to Vaadin 8. But I just can't get the grid to display anything even in the most basic example (using Vaadin archetype) on neither Firefox or IE11. The only thing I see is Grid border (See attached)
In another caveat I was able to display the scrollbar on the right side if I populate grid with a lot of values but still no columns and rows. Here is my code
@Override protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
Label label = new Label("My Grid:");
ArrayList<Person> persons = new ArrayList<>();
persons.add(new Person());
Grid<Person> grid = new Grid<>();
grid.setItems(persons);
layout.addComponents(label, grid);
setContent(layout);
}
static class Person { String name = "Name"; String lastName = "LastName"; }
Hi,
try defining some columns with grid.addColumn
-Olli
I'm not sure why your Person class is static our if that has any impact, but what happens if you change line 5 to
Grid<Person> grid = new Grid<>(Person.class)?
You might still need to add the columns using grid.addColumn("name") etc. - I don't remember if that constructor automatically add columns in Vaadin 8 and I'm not at a computer to check.
Thanks.
Adding the Person.class and defining the POJO as a separate public class has done the trick
Apparaently the POJO MUST be public for it to work. Strange! I get this otherwise
java.lang.IllegalAccessException: Class com.vaadin.data.BeanPropertySet can not access a member of class Vaadin8Learning.Person with modifiers "public"