From 6b071fcef7e9f5bd45036b05e73c25e310c7b04d Mon Sep 17 00:00:00 2001 From: Arved Solth Date: Thu, 2 Nov 2023 08:32:34 +0100 Subject: [PATCH] Reload page on client change --- .../production/controller/SessionClientController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Kitodo/src/main/java/org/kitodo/production/controller/SessionClientController.java b/Kitodo/src/main/java/org/kitodo/production/controller/SessionClientController.java index 1aba07941d4..38d1e832539 100644 --- a/Kitodo/src/main/java/org/kitodo/production/controller/SessionClientController.java +++ b/Kitodo/src/main/java/org/kitodo/production/controller/SessionClientController.java @@ -15,6 +15,7 @@ import java.util.Objects; import javax.enterprise.context.RequestScoped; +import javax.faces.context.FacesContext; import javax.inject.Named; import org.kitodo.data.database.beans.Client; @@ -134,8 +135,12 @@ public void setSelectedClient(Client selectedClient) { * @param sessionClient * The client object that is to be the new session client. */ - public void setSessionClient(Client sessionClient) { + public String setSessionClient(Client sessionClient) { ServiceManager.getUserService().getAuthenticatedUser().setSessionClient(sessionClient); + if (Objects.nonNull(FacesContext.getCurrentInstance())) { + return FacesContext.getCurrentInstance().getViewRoot().getViewId(); + } + return null; } /**