0

Trying to get the related items name to display within a Vaadin Grid.

This will get the name of the main item:

grid.addColumn(thing::getName).setCaption("Name"); 

This will return the object of the related item:

grid.addColumn(thing::getRelatedThing).setCaption("Related Thing Name"); 
code
  • 4,073
  • 3
  • 27
  • 47

1 Answers1

1

The answer is fairly simple. Placing here in case it might help others or maybe someone has a better way.

grid.addColumn(e -> e.getRelatedThing.getName).setCaption("Related Thing Name"); 
code
  • 4,073
  • 3
  • 27
  • 47