5
0
mirror of https://github.com/AJMicke/KickerELO.git synced 2026-03-11 21:41:02 +01:00

views: Reset input fields after successful save

This commit is contained in:
Sebastian Beckmann
2025-04-11 16:34:22 +02:00
committed by AJMicke
parent 818a0bced3
commit e596cdd9c4
2 changed files with 12 additions and 0 deletions

View File

@@ -38,6 +38,9 @@ public class Enter1vs1View extends VerticalLayout {
try {
eloService.enterResult1vs1(winnerSelect.getValue(), loserSelect.getValue(), loserGoals.getValue().shortValue());
Notification.show("Gespeichert").addThemeVariants(NotificationVariant.LUMO_SUCCESS);
winnerSelect.setValue(null);
loserSelect.setValue(null);
loserGoals.setValue(0);
} catch (NoSuchPlayerException err) {
Notification.show("Unbekannter Spieler").addThemeVariants(NotificationVariant.LUMO_ERROR);
} catch (DuplicatePlayerException err) {
@@ -47,7 +50,9 @@ public class Enter1vs1View extends VerticalLayout {
} catch (InvalidDataException err) {
Notification.show("Verliertore falsch").addThemeVariants(NotificationVariant.LUMO_ERROR);
}
e.getSource().setEnabled(true);
});
saveButton.setDisableOnClick(true);

View File

@@ -45,6 +45,11 @@ public class Enter2vs2View extends VerticalLayout {
try {
eloService.enterResult2vs2(winnerFrontSelect.getValue(), winnerBackSelect.getValue(), loserFrontSelect.getValue(), loserBackSelect.getValue(), loserGoals.getValue().shortValue());
Notification.show("Gespeichert").addThemeVariants(NotificationVariant.LUMO_SUCCESS);
winnerFrontSelect.setValue(null);
winnerBackSelect.setValue(null);
loserFrontSelect.setValue(null);
loserBackSelect.setValue(null);
loserGoals.setValue(0);
} catch (NoSuchPlayerException err) {
Notification.show("Unbekannter Spieler").addThemeVariants(NotificationVariant.LUMO_ERROR);
} catch (DuplicatePlayerException err) {
@@ -54,7 +59,9 @@ public class Enter2vs2View extends VerticalLayout {
} catch (InvalidDataException err) {
Notification.show("Verliertore falsch").addThemeVariants(NotificationVariant.LUMO_ERROR);
}
e.getSource().setEnabled(true);
});
saveButton.setDisableOnClick(true);
// Use custom CSS classes to apply styling. This is defined in