From cbc5269afeeed68bf1f69607d721a2fb17f61cce Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 22 Feb 2013 17:33:30 +0800 Subject: [PATCH] IDEMPIERE-636 Breadcrumb showing non-displayed tabs. --- .../webui/adwindow/CompositeADTabbox.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java index 369a9e5f8c..ebc946b3cf 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java @@ -369,14 +369,15 @@ public class CompositeADTabbox extends AbstractADTabbox protected void updateTabState() { if (isDetailPaneLoaded()) { + boolean hasChanges = false; for(int i = 0; i < headerTab.getDetailPane().getTabcount(); i++) { IADTabpanel adtab = headerTab.getDetailPane().getADTabpanel(i); if (adtab.getDisplayLogic() != null && adtab.getDisplayLogic().trim().length() > 0) { - if (!Evaluator.evaluateLogic(headerTab, adtab.getDisplayLogic())) { - headerTab.getDetailPane().setTabVisibility(i, false); - } else { - headerTab.getDetailPane().setTabVisibility(i, true); + boolean visible = Evaluator.evaluateLogic(headerTab, adtab.getDisplayLogic()); + if (headerTab.getDetailPane().isTabVisible(i) != visible) { + headerTab.getDetailPane().setTabVisibility(i, visible); + hasChanges = true; } } } @@ -392,7 +393,10 @@ public class CompositeADTabbox extends AbstractADTabbox break; } } + hasChanges = true; } + if (hasChanges) + headerTab.getDetailPane().invalidate(); } } @@ -528,6 +532,12 @@ public class CompositeADTabbox extends AbstractADTabbox tabLabel = tabLabelList.get(i); if (tabLabel.tabLevel == headerTab.getTabLevel()) { + IADTabpanel adtab = tabPanelList.get(i); + if (adtab.getDisplayLogic() != null && adtab.getDisplayLogic().trim().length() > 0) { + if (!Evaluator.evaluateLogic(headerTab, adtab.getDisplayLogic())) { + continue; + } + } links.put(Integer.toString(i), tabLabel.label); } else if (tabLabel.tabLevel < headerTab.getTabLevel()) { break;