From 53c142a32c43a3fa6838b13f7cd427e3f0a1609b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jul 2014 12:53:51 -0500 Subject: [PATCH] IDEMPIERE-2086 Task not working on zk --- .../adempiere/webui/dashboard/DPFavourites.java | 2 +- .../src/org/adempiere/webui/window/WTask.java | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java index 4dc7551224..d5bba7f3fd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPFavourites.java @@ -353,7 +353,7 @@ public class DPFavourites extends DashboardPanel implements EventListener return "images/mWindow.png"; if (mt.isReport()) return "images/mReport.png"; - if (mt.isProcess()) + if (mt.isProcess() || mt.isTask()) return "images/mProcess.png"; if (mt.isWorkFlow()) return "images/mWorkFlow.png"; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java index 8a85aca810..3eb4ee8696 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WTask.java @@ -37,9 +37,9 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; -import org.zkoss.zul.South; import org.zkoss.zul.Div; import org.zkoss.zul.Html; +import org.zkoss.zul.South; /** * Application Task @@ -96,7 +96,14 @@ public class WTask extends Window implements EventListener, IHelpContext SessionManager.getAppDesktop().showWindow(this); - Events.echoEvent("executeTask", this, null); + addEventListener("onExecuteTask", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + executeTask(); + } + }); + + Events.echoEvent("onExecuteTask", this, null); } catch(Exception e) { @@ -204,8 +211,8 @@ public class WTask extends Window implements EventListener, IHelpContext taskThread.interrupt(); else if (e.getName().equals(WindowContainer.ON_WINDOW_CONTAINER_SELECTION_CHANGED_EVENT)) SessionManager.getAppDesktop().updateHelpContext(X_AD_CtxHelp.CTXTYPE_Task, m_task.getAD_Task_ID()); - - SessionManager.getAppDesktop().closeActiveWindow(); + else if (e.getName().equals(Events.ON_CLICK)) + SessionManager.getAppDesktop().closeActiveWindow(); } // actionPerformed } // ATask