-1

I'd like to insert the property(string) of an embedded object with addColumn.

My code is just :

tarifsLignesGrid.addColumn(TarifsLignes::getProducts).setCaption(TITRE_PRODUITS)

the getProduct return a Product entity in which I'd like to take the name property instead of the toString.

Wise
  • 3
  • 2

1 Answers1

0

A lot more context would be nice, but I'll take a stab in the dark. Assuming the Product class has a getName() method:

tarifsLignesGrid.addColumn(t -> t.getProducts().getName()).setCaption(TITRE_PRODUITS)
lucasvw
  • 1,345
  • 17
  • 36
  • Sorry for the context I ll do it next time, and thanks a lot for this good answer. I'm not really familiar with this way of writing. Thanks again – Wise Apr 28 '17 at 00:52
  • @Wise If this solved your problem, please upvote and accept my answer – lucasvw Apr 28 '17 at 13:06
  • you solved it but I can't upvote your answer to new in stackoverflow. Thanks again – Wise Apr 28 '17 at 21:43