From b129228b363a566ebd9ab64766e56bb80c0e0f52 Mon Sep 17 00:00:00 2001 From: Joern Muehlencord Date: Sat, 21 Nov 2020 16:20:35 +0100 Subject: [PATCH] added addMessage(clientId, message, validationFailed) --- .../de/muehlencord/shared/jeeutil/FacesUtil.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java index c24022d..9599d97 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java @@ -69,6 +69,19 @@ public abstract class FacesUtil { FacesContext.getCurrentInstance().addMessage(clientId, message); } + /** + * Adds the given message to the object with the id specified by clientId. + * + * @param clientId the id of the object to bind the message to. + * @param message the message to display + */ + public static void addMessage(String clientId, FacesMessage message, boolean validationFailed) { + FacesContext.getCurrentInstance().addMessage(clientId, message); + if (validationFailed) { + FacesContext.getCurrentInstance().validationFailed(); + } + } + /** * Adds the given message as global message. *