Vaadin 8 Grid中有沒有一種方法可以自動將所有JavaBean-pattern屬性顯示爲表中的列?並自動標記每個列標題的屬性的名稱?在Vaadin 8網格中默認添加我的JavaBean的所有屬性爲列?
在綁定到數據部分this page in the Vaadin guide,我們看到這個代碼,我們必須明確指定哪些屬性用作網格中的列。
Grid<Person> grid = new Grid<>();
grid.setItems(people);
grid.addColumn(Person::getName).setCaption("Name");
grid.addColumn(Person::getBirthYear).setCaption("Year of birth");