IDEMPIERE-1275 Accounting Dimensions Navigation is broken.

This commit is contained in:
Heng Sin Low 2013-08-15 09:43:52 +08:00
parent 28f2fa1c06
commit 2ab43bafcd
3 changed files with 56 additions and 21 deletions

View File

@ -492,5 +492,9 @@ public class BreadCrumb extends Div implements EventListener<Event> {
public ToolBarButton getPreviousButton() {
return btnPrevious;
}
}
public boolean isEmpty() {
return layout == null || layout.getChildren().isEmpty();
}
}

View File

@ -349,9 +349,8 @@ public class CompositeADTabbox extends AbstractADTabbox
if (layout.getChildren().isEmpty()) {
layout.appendChild(tabPanel);
headerTab = tabPanel;
updateBreadCrumb();
} else if (tabLabel.tabLevel <= 1) {
headerTab = tabPanel;
} else if (tabLabel.tabLevel == 1) {
if (headerTab.getDetailPane() == null) {
headerTab.setDetailPane(createDetailPane());
} else
@ -360,7 +359,7 @@ public class CompositeADTabbox extends AbstractADTabbox
headerTab.getDetailPane().addADTabpanel(tabPanel, tabLabel);
tabPanel.setDetailPaneMode(true);
headerTab.getDetailPane().setVflex("true");
} else {
} else if (tabLabel.tabLevel > 1){
headerTab.getDetailPane().addADTabpanel(tabPanel, tabLabel, false);
tabPanel.setDetailPaneMode(true);
headerTab.getDetailPane().setVflex("true");
@ -372,6 +371,18 @@ public class CompositeADTabbox extends AbstractADTabbox
tabPanel.getGridTab().addDataStatusListener(new SyncDataStatusListener(tabPanel));
}
@Override
public boolean updateSelectedIndex(int oldIndex, int newIndex) {
boolean b = super.updateSelectedIndex(oldIndex, newIndex);
if (b) {
BreadCrumb breadcrumb = getBreadCrumb();
if (breadcrumb.isEmpty()) {
updateBreadCrumb();
}
}
return b;
}
private void activateDetailIfVisible() {
if (headerTab instanceof ADTabpanel) {
((ADTabpanel)headerTab).activateDetailIfVisible();
@ -460,7 +471,7 @@ public class CompositeADTabbox extends AbstractADTabbox
IADTabpanel tabPanel = tabPanelList.get(i);
int tabLevel = tabPanel.getTabLevel();
ADTabListModel.ADTabLabel tabLabel = tabLabelList.get(i);
if ((tabLevel - currentLevel) == 1 || (tabLevel == 0 && currentLevel == 0)) {
if ((tabLevel - currentLevel) == 1) {
tabIndex++;
Object[] value = new Object[]{tabIndex, tabPanel, tabLabel, Boolean.TRUE};
list.add(value);
@ -593,20 +604,39 @@ public class CompositeADTabbox extends AbstractADTabbox
}
}
}
for(int i = parentIndex+1; i < tabLabelList.size(); i++) {
if (i == selectedIndex) continue;
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;
if (headerTab.getTabLevel() == 0)
{
for(int i = 0; i < tabLabelList.size(); i++) {
if (i == selectedIndex) continue;
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
{
for(int i = parentIndex+1; i < tabLabelList.size(); i++) {
if (i == selectedIndex) continue;
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;
}
}
}

View File

@ -176,5 +176,6 @@ public interface IADTabbox extends UIPart {
/**
* @return true if all the tabs of detail pane have been linked up with adtabpanel
*/
boolean isDetailPaneLoaded();
public boolean isDetailPaneLoaded();
}