如何使用vaadin检查所有使用复选框的复选框
问题描述:
如何使用vVadin新建复选框。我创建了一个带有两列网格的项目,但我想添加一个Textfield列和一个复选框列,并在单击标题复选框时选中所有复选框。如何使用vaadin检查所有使用复选框的复选框
List<Person> people = Arrays.asList(
new Person("Nicolaus Copernicus", 15),
new Person("Galileo Galilei", 15),
new Person("Johannes Kepler", 15));
TextField txt =new TextField();
CheckBox chk=new CheckBox();
// Create a grid bound to the list
Grid<Person> grid = new Grid<>();
grid.setItems(people);
grid.addColumn(Person::getName).setCaption("Name");
grid.addColumn(Person::getAge).setCaption("Year of birth");
grid.addColumn(Person-> new TextField());
layout.addComponents(grid);
setParent(layout);
任何人都可以提出me.how添加这两列通过复选框
答案有帮助吗? –