From 9bfe16a8ca89de7868e5e0d4d666c88f141623e3 Mon Sep 17 00:00:00 2001 From: Thomas Oster Date: Mon, 10 Jan 2022 22:58:11 +0100 Subject: [PATCH] Fix for https://github.com/TheCoder4eu/BootsFaces-OSP/issues/750 --- .../net/bootsfaces/component/ajax/AJAXRenderer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java b/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java index 21a3890ea..589319628 100644 --- a/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java +++ b/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java @@ -379,7 +379,15 @@ public static boolean generateAJAXCallForASingleEvent(FacesContext context, Clie jsCallback = ""; } if (null != rw) { - rw.writeAttribute("on" + keyClientBehavior, jsCallback + script, null); + boolean ajax = ((IAJAXComponent) component).isAjax(); + ajax |= null != ((IAJAXComponent) component).getUpdate(); + if (!generatedAJAXCall && ajax && "click".equals(keyClientBehavior)) { + //ajax call will be generated later, so skip for now + //see https://github.com/TheCoder4eu/BootsFaces-OSP/issues/750 + } + else { + rw.writeAttribute("on" + keyClientBehavior, jsCallback + script, null); + } } if (null != code) { code.append(jsCallback + script);