From 2a57e05b881da9ade1dec8a988428e09af85a598 Mon Sep 17 00:00:00 2001 From: Markus Kreth Date: Thu, 31 Jan 2019 22:34:43 +0100 Subject: [PATCH] Bugfix Calendarreload --- .../kreth/vaadin/clubhelper/vaadinclubhelper/ui/MainView.java | 3 +-- .../vaadinclubhelper/ui/components/CalendarComponent.java | 1 + .../vaadinclubhelper/ui/components/ZonedDateTimeConverter.java | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/MainView.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/MainView.java index b14c4cb..4e4eec5 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/MainView.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/MainView.java @@ -74,8 +74,6 @@ public class MainView extends VerticalLayout implements NamedView { openPersonViewForEvent(current); if (current != null) { calendar.setToday(current.getStart()); - } else { - reloadEvents(); } head.updateLoggedinPerson(); } else { @@ -83,6 +81,7 @@ public class MainView extends VerticalLayout implements NamedView { detailClosed(); head.updateLoggedinPerson(); } + reloadEvents(); } } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/CalendarComponent.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/CalendarComponent.java index 4a30acc..85d3311 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/CalendarComponent.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/CalendarComponent.java @@ -81,6 +81,7 @@ public class CalendarComponent extends CustomComponent { @Override public void setItems(Collection items) { + super.itemList.clear(); super.setItems(items); fireItemSetChanged(); } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/ZonedDateTimeConverter.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/ZonedDateTimeConverter.java index e48e119..a01d2c4 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/ZonedDateTimeConverter.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/ZonedDateTimeConverter.java @@ -15,6 +15,9 @@ public class ZonedDateTimeConverter implements Converter convertToModel(LocalDate value, ValueContext context) { + if (value == null) { + return Result.ok(null); + } return Result.ok(ZonedDateTime.of(value, LocalTime.MIDNIGHT, ZoneId.systemDefault())); }