Grid with nested property

Hey,

I have 2 classes, Person and Company. Person has a relationship “ManyToOne” to Company.

Now I wanted to show all persons in a grid with one column for the name of company. When I set the columns of my grid like that I get an NullPointerException:

getGrid().setColumns("name", "firstname","company.name"); When I just use “company” instead of “company.name” it works, but then I get the identifier of the object.

Hope you can help me. Thanks.

-Yacin

My understanding is that you should get illegal argument exceptiomn instead, since both “name” and “company.name” are ending with “name”, which will be used as identifier and will be a conflict.

Yes, your are right. I solved it now like that:

getGrid().addColumn(person -> person.getCompany() == null ? "": person.getCompany().getName()).setCaption("Company Name").setId("companyName");
getGrid().setColumns("name", "firstname", "companyName");