Grid with embeddable twice

Hi all,
I am using Vaadin 10 Beta 3.
I want to create a Grid showing Customers. My customer has a shippingAddress of type Address and a billingAddress of type Address.
For simplicity let’s say Address has just 1 field “firstName”

I’ve added “shippingAddress.firstName” when I add “billingAddress.firstName” I get an IllegalArgumentException “Multiple columns for the same property” from Grid line 971.
I use Grid.addColumn(String propertyName).

As far as I can see in the debugger NestedBeanPropertyDefinition useLongFormName = false. I assume it should be true or am I doing something wrong here?

PS: After changing com.vaadin.flow.data.binder.BeanPropertySet.getProperty(String) for a test to
NestedBeanPropertyDefinition<T, ?> nestedDefinition = new NestedBeanPropertyDefinition<>(this, parent.get(), descriptor.get(), true)
it worked for me. (note the “true” at the end.)

Hello Nikolai!

I was not able to reproduce this problem with a similar demo, by adding columns for two different subproperties of the same type:

grid.addColumn("address.postalCode");
grid.addColumn("address2.postalCode");

The property names return the full name: address.postalCode and address2.postalCode, so they do not conflict and everything works fine.

I guess in your case the property names don’t contain the name of the parent, and they are just eg. fistName for both subproperties. Can you verify this? The conflicting property name should be logged after the “Multiple columns for the same property”-message.

Also, I can’t find any NestedBeanPropertyDefinition.useLongFormName that you mentioned. Can you verify that you definitely have the correct version of flow-data, so there is flow-data-1.0.0.beta3.jar on your classpath?

Br,
Pekka

Looks like this Issue has been fixed by vaadin in the meantime. The NestedBeanPropertyDefinition.useLongFormName was part of flow-data-1.0.0.beta3.jar
I’ve updated to beta7 and the useLongFormName has been removed and the getName() returns now always
parent.getName() + "." + super.getName()