From a6063690e9c2a3aec68833447685d332c1f73e5a Mon Sep 17 00:00:00 2001 From: filippo-ferrari Date: Sat, 25 May 2024 15:18:48 +0200 Subject: [PATCH] fix: category column --- .../com/application/munera/views/expenses/ExpensesView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/application/munera/views/expenses/ExpensesView.java b/src/main/java/com/application/munera/views/expenses/ExpensesView.java index 9b37412..6a8b869 100644 --- a/src/main/java/com/application/munera/views/expenses/ExpensesView.java +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -80,7 +80,9 @@ public class ExpensesView extends Div implements BeforeEnterObserver { // Configure Grid grid.addColumn(Expense::getName).setHeader("Name").setSortable(true); grid.addColumn(Expense::getCost).setHeader("Amount").setSortable(true); - grid.addColumn(Expense::getCategory).setHeader("Category").setSortable(true); + grid.addColumn(expenseCategory -> expenseCategory.getCategory().getName()) + .setHeader("Category") + .setSortable(true); grid.addColumn(Expense::getPeriodInterval).setHeader("Period Interval").setSortable(true); grid.addColumn(Expense::getPeriodUnit).setHeader("Period Unit").setSortable(true); grid.addColumn(Expense::getDate).setHeader("Date").setSortable(true);