From e391acaf5155cf755a49f0c5fc9e5994b934b612 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 8 Nov 2013 10:23:01 +0800 Subject: [PATCH] IDEMPIERE-1513 Find Window : should hide simple search tab if there's no selection column define. --- .../adempiere/webui/window/FindWindow.java | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index b6a558974a..737ba3b619 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -269,6 +269,13 @@ public class FindWindow extends Window implements EventListener, ValueCha { return false; } + + if (!winMain.getComponent().getTabpanel(0).isVisible()) + { + winMain.getComponent().setSelectedIndex(1); + onAdvanceTabSelected(); + } + return true; } @@ -676,6 +683,12 @@ public class FindWindow extends Window implements EventListener, ValueCha addSelectionColumn (field); } + if (m_sEditors.isEmpty()) { + Tabpanel tabPanel = winMain.getComponent().getTabpanel(0); + tabPanel.getLinkedTab().setVisible(false); + tabPanel.setVisible(false); + } + gridFieldList = null; m_total = getNoOfRecords(null, false); @@ -1072,16 +1085,9 @@ public class FindWindow extends Window implements EventListener, ValueCha } else if (event.getTarget() instanceof Tab) { if (winMain.getComponent().getSelectedIndex() == 1) { - fQueryName.setReadonly(false); - btnSave.setDisabled(m_AD_Tab_ID <= 0); - historyCombo.setSelectedItem(null); - if (advancedPanel.getItems().size() == 0) { - createFields(); - } + onAdvanceTabSelected(); } else { - fQueryName.setReadonly(true); - btnSave.setDisabled(true); - historyCombo.setDisabled(false); + onSimpleTabSelected(); } } } // @@ -1171,6 +1177,21 @@ public class FindWindow extends Window implements EventListener, ValueCha } // onEvent + private void onSimpleTabSelected() { + fQueryName.setReadonly(true); + btnSave.setDisabled(true); + historyCombo.setDisabled(false); + } + + private void onAdvanceTabSelected() { + fQueryName.setReadonly(false); + btnSave.setDisabled(m_AD_Tab_ID <= 0); + historyCombo.setSelectedItem(null); + if (advancedPanel.getItems().size() == 0) { + createFields(); + } + } + private void parseUserQuery(MUserQuery userQuery) { String code = userQuery.getCode();