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 42b7bab..26a3a7c 100644 --- a/src/main/java/com/application/munera/views/expenses/ExpensesView.java +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -30,7 +30,6 @@ import com.vaadin.flow.component.textfield.TextField; import com.vaadin.flow.data.binder.BeanValidationBinder; import com.vaadin.flow.data.binder.ValidationException; import com.vaadin.flow.data.renderer.ComponentRenderer; -import com.vaadin.flow.data.renderer.LitRenderer; import com.vaadin.flow.router.*; import com.vaadin.flow.spring.data.VaadinSpringDataHelpers; import org.springframework.data.domain.PageRequest; @@ -234,8 +233,6 @@ public class ExpensesView extends Div implements BeforeEnterObserver { category.setItems(categoryService.findAll()); category.setItemLabelGenerator(Category::getName); description = new TextArea("Description"); - isPeriodic = new Checkbox("Is Periodic"); - isResolved = new Checkbox("Paid"); periodUnit = new ComboBox<>("Period Unit"); periodUnit.setItems(PeriodUnit.values()); periodInterval = new TextField("Period Interval"); @@ -249,15 +246,14 @@ public class ExpensesView extends Div implements BeforeEnterObserver { debtors.setItems(personService.findAll()); debtors.setItemLabelGenerator(Person::getFirstName); date = new DatePicker("Date"); - LitRenderer isPeriodicRenderer = LitRenderer.of( - "") - .withProperty("icon", important -> important.getIsPeriodic() ? "check" : "minus").withProperty("color", - important -> important.getIsPeriodic() - ? "var(--lumo-primary-text-color)" - : "var(--lumo-disabled-text-color)"); - formLayout.add(name, cost, category, description, isPeriodic, isResolved, periodUnit, periodInterval, date, creditors, debtors, event); - grid.addColumn(isPeriodicRenderer).setHeader("Periodic").setAutoWidth(true); + // Horizontal layout for checkboxes + HorizontalLayout checkboxLayout = new HorizontalLayout(); + isPeriodic = new Checkbox("Is Periodic"); + isResolved = new Checkbox("Paid"); + checkboxLayout.add(isPeriodic, isResolved); + + formLayout.add(name, cost, category, description, checkboxLayout, periodUnit, periodInterval, date, creditors, debtors, event); editorDiv.add(formLayout); createButtonLayout(editorLayoutDiv);