2
假设我有下面的情况下设置成员对象的字段:Vaadin电网setColumn() - 作为列
有两个实体:
public class Address {
private City city;
private String street;
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
而且
public class City {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
我想使用BeanItemContainer在网格组件上显示街道和城市名称,应如何指定列名称? P尝试使用“street”和“city.name”,但它引发异常。
java.lang.IllegalStateException: Found at least one column in Grid that does not exist in the given container: city.name with the header "Name". Call removeAllColumns() before setContainerDataSource() if you want to reconfigure the columns based on the new container.