feat: button disable logic

This commit is contained in:
effe 2024-09-10 12:26:20 -04:00
parent 039ffda656
commit 3b2fd229a5

View file

@ -97,6 +97,7 @@ public class PeopleView extends Div implements BeforeEnterObserver {
} else if (persona instanceof Expense) { } else if (persona instanceof Expense) {
Button setExpensePaidButton = new Button("Set as paid", event -> this.expenseFacade.setExpensePaid((Expense) persona, grid)); Button setExpensePaidButton = new Button("Set as paid", event -> this.expenseFacade.setExpensePaid((Expense) persona, grid));
setExpensePaidButton.addThemeVariants(ButtonVariant.LUMO_SMALL); setExpensePaidButton.addThemeVariants(ButtonVariant.LUMO_SMALL);
if (Boolean.TRUE.equals(((Expense) persona).getIsPaid())) setExpensePaidButton.setEnabled(false);
return setExpensePaidButton; return setExpensePaidButton;
} else return new Span(); } else return new Span();
})); }));