IDEMPIERE-369 Master Detail layout improvements. Make detail tabpane smaller for split view. Auto scroll to detail tab for non-split view.

This commit is contained in:
Heng Sin Low 2012-11-23 16:57:26 +08:00
parent 3e4c1a7103
commit b0c509fa06
4 changed files with 34 additions and 6 deletions

View File

@ -571,6 +571,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
private void initFirstTabpanel() {
adTabbox.getSelectedTabpanel().query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords());
adTabbox.getSelectedTabpanel().activate(true);
Events.echoEvent(new Event("onPostInit", adTabbox.getComponent()));
}
/**

View File

@ -188,6 +188,13 @@ public class CompositeADTabbox extends AbstractADTabbox
}
});
layout.addEventListener("onPostInit", new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
layout.invalidate();
}
});
return layout;
}
@ -303,7 +310,6 @@ public class CompositeADTabbox extends AbstractADTabbox
} else
tabPanel.setVisible(false);
detailPane.setHflex("1");
detailPane.setStyle("min-height: 200px; overflow-y: visible;");
detailPane.addADTabpanel(tabPanel, tabLabel);
tabPanel.setDetailPaneMode(true, isUseVflexForDetailPane());
detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane()));
@ -542,7 +548,7 @@ public class CompositeADTabbox extends AbstractADTabbox
detailTab.setDetailPaneMode(true, isUseVflexForDetailPane());
detailPane.setVflex(Boolean.toString(isUseVflexForDetailPane()));
if (!ADTabpanel.isUseSplitViewForForm()) {
detailPane.invalidate();
layout.invalidate();
}
}
}
@ -645,6 +651,9 @@ public class CompositeADTabbox extends AbstractADTabbox
detailPane.updateToolbar(false, true);
} else {
tabPanel.dynamicDisplay(0);
if (!ADTabpanel.isUseSplitViewForForm() && !headerTab.isGridView()) {
detailPane.invalidate();
}
}
}

View File

@ -91,14 +91,22 @@ public class DetailPane extends Panel implements EventListener<Event> {
@Override
public void onEvent(Event event) throws Exception {
fireActivateDetailEvent();
if (!ADTabpanel.isUseSplitViewForForm()) {
Clients.scrollIntoView(getSelectedADTabpanel());
}
}
});
tabbox.setSclass("adwindow-detailpane-tabbox");
if (!ADTabpanel.isUseSplitViewForForm()) {
LayoutUtils.addSclass("adwindow-detailpane-tabbox-xsplit", tabbox);
}
createPopup();
this.setSclass("adwindow-detailpane");
if (!ADTabpanel.isUseSplitViewForForm()) {
LayoutUtils.addSclass("adwindow-detailpane-xsplit", this);
}
}
public int getSelectedIndex() {

View File

@ -506,7 +506,12 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
}
.adwindow-detailpane {
min-height: 200px; width: 100%; overflow-y: visible;
width: 100%;
overflow-y: visible;
}
.adwindow-detailpane-xsplit {
min-height: 200px;
}
.adwindow-detailpane-tabpanel {
@ -531,12 +536,17 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
}
.adwindow-detailpane-tabbox {
min-height: 200px; width: 99%; margin: auto;
width: 99%;
margin: auto;
background-color: #E4E4E4;
}
.adwindow-detailpane-tabbox-xsplit .z-tabpanel {
min-height: 200px;
}
.adwindow-gridview-detail {
height: 250px;
height: 40%;
}
.adwindow-gridview-detail + .z-south-splt {