IDEMPIERE-636 Breadcrumb showing non-displayed tabs.

This commit is contained in:
Heng Sin Low 2013-02-22 17:33:30 +08:00
parent abf201f9b6
commit cbc5269afe
1 changed files with 14 additions and 4 deletions

View File

@ -369,14 +369,15 @@ public class CompositeADTabbox extends AbstractADTabbox
protected void updateTabState() { protected void updateTabState() {
if (isDetailPaneLoaded()) if (isDetailPaneLoaded())
{ {
boolean hasChanges = false;
for(int i = 0; i < headerTab.getDetailPane().getTabcount(); i++) for(int i = 0; i < headerTab.getDetailPane().getTabcount(); i++)
{ {
IADTabpanel adtab = headerTab.getDetailPane().getADTabpanel(i); IADTabpanel adtab = headerTab.getDetailPane().getADTabpanel(i);
if (adtab.getDisplayLogic() != null && adtab.getDisplayLogic().trim().length() > 0) { if (adtab.getDisplayLogic() != null && adtab.getDisplayLogic().trim().length() > 0) {
if (!Evaluator.evaluateLogic(headerTab, adtab.getDisplayLogic())) { boolean visible = Evaluator.evaluateLogic(headerTab, adtab.getDisplayLogic());
headerTab.getDetailPane().setTabVisibility(i, false); if (headerTab.getDetailPane().isTabVisible(i) != visible) {
} else { headerTab.getDetailPane().setTabVisibility(i, visible);
headerTab.getDetailPane().setTabVisibility(i, true); hasChanges = true;
} }
} }
} }
@ -392,7 +393,10 @@ public class CompositeADTabbox extends AbstractADTabbox
break; break;
} }
} }
hasChanges = true;
} }
if (hasChanges)
headerTab.getDetailPane().invalidate();
} }
} }
@ -528,6 +532,12 @@ public class CompositeADTabbox extends AbstractADTabbox
tabLabel = tabLabelList.get(i); tabLabel = tabLabelList.get(i);
if (tabLabel.tabLevel == headerTab.getTabLevel()) { 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); links.put(Integer.toString(i), tabLabel.label);
} else if (tabLabel.tabLevel < headerTab.getTabLevel()) { } else if (tabLabel.tabLevel < headerTab.getTabLevel()) {
break; break;