From b32c97c23d5304fbeb8deb03ded964ee0dbc54d4 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 15 Dec 2009 02:27:53 +0000 Subject: [PATCH] https://sourceforge.net/tracker/?func=detail&atid=955896&aid=2912815&group_id=176962 [JasperReport in process problem] - fallback to highlighted mode if modal mode is not available --- .../webui/desktop/AbstractDesktop.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java b/zkwebui/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java index bd5e6b1694..ecaa64f122 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java @@ -23,6 +23,7 @@ import org.adempiere.webui.part.AbstractUIPart; import org.compiere.model.MMenu; import org.compiere.util.CLogger; import org.compiere.util.Env; +import org.zkoss.zk.ui.event.Events; /** * Base class for desktop implementation @@ -35,6 +36,7 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop private List windows = null; + @SuppressWarnings("unused") private static final CLogger logger = CLogger.getCLogger(AbstractDesktop.class); public AbstractDesktop() { @@ -186,14 +188,22 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop */ protected void showModal(Window win) { - try - { - win.doModal(); - } - catch(InterruptedException e) - { - - } + //fall back to highlighted if can't execute doModal + if (Events.inEventListener()) + { + try + { + win.doModal(); + } + catch(InterruptedException e) + { + + } + } + else + { + showHighlighted(win, null); + } }