From a0e53c825e9d7588429f2b8fab0eb08489ea9670 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 4 Dec 2013 18:29:47 +0800 Subject: [PATCH] IDEMPIERE-1335 Info window multi-select for product info is broken. --- .../src/org/adempiere/webui/panel/InfoPanel.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index 1f30e704dd..d567fc8972 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -75,6 +75,7 @@ import org.zkoss.zk.ui.Page; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; +import org.zkoss.zk.ui.event.SelectEvent; import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Listhead; import org.zkoss.zul.Listheader; @@ -388,6 +389,7 @@ public abstract class InfoPanel extends Window implements EventListener, private int cacheEnd; private boolean m_useDatabasePaging = false; private BusyDialog progressWindow; + private Listitem m_lastOnSelectItem; private static final String[] lISTENER_EVENTS = {}; @@ -740,6 +742,7 @@ public abstract class InfoPanel extends Window implements EventListener, return; } contentPanel.addEventListener(Events.ON_DOUBLE_CLICK, this); + contentPanel.addEventListener(Events.ON_SELECT, this); } protected void insertPagingComponent() { @@ -1124,8 +1127,19 @@ public abstract class InfoPanel extends Window implements EventListener, { onOk(); } + else if (event.getTarget() == contentPanel && event.getName().equals(Events.ON_SELECT)) + { + m_lastOnSelectItem = null; + SelectEvent selectEvent = (SelectEvent) event; + if (selectEvent.getReference() != null && selectEvent.getReference() instanceof Listitem) + m_lastOnSelectItem = (Listitem) selectEvent.getReference(); + } else if (event.getTarget() == contentPanel && event.getName().equals(Events.ON_DOUBLE_CLICK)) { + if (contentPanel.isMultiple()) { + if (m_lastOnSelectItem != null) + contentPanel.setSelectedItem(m_lastOnSelectItem); + } onDoubleClick(); } else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_REFRESH)))