IDEMPIERE-369 Master Detail layout improvements. Performance tuning - reduce use of borderlayout.

This commit is contained in:
Heng Sin Low 2012-12-31 12:18:50 +08:00
parent caf7b53e5e
commit 45d88ff3ab
5 changed files with 57 additions and 30 deletions

View File

@ -189,6 +189,7 @@ DataStatusListener, IADTabpanel, IdSpace
removeAttribute(ATTR_ON_ACTIVATE_POSTED);
}
});
addEventListener("onPostInit", this);
}
private void initComponents()
@ -930,6 +931,11 @@ DataStatusListener, IADTabpanel, IdSpace
else if (WPaymentEditor.ON_SAVE_PAYMENT.equals(event.getName())) {
windowPanel.onSavePayment();
}
else if ("onPostInit".equals(event.getName())) {
if (detailPane != null) {
Events.postEvent(new Event(LayoutUtils.ON_REDRAW_EVENT, detailPane));
}
}
}
private void navigateTo(DefaultTreeNode<MTreeNode> value) {

View File

@ -36,12 +36,9 @@ import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.KeyEvent;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center;
import org.zkoss.zul.Div;
import org.zkoss.zul.North;
import org.zkoss.zul.South;
import org.zkoss.zul.Tab;
import org.zkoss.zul.Vlayout;
/**
*
@ -58,9 +55,9 @@ public class ADWindowContent extends AbstractADWindowContent
@SuppressWarnings("unused")
private static final CLogger logger = CLogger.getCLogger(ADWindowContent.class);
private Borderlayout layout;
private Vlayout layout;
private Center contentArea;
private Div contentArea;
private Keylistener keyListener;
@ -71,7 +68,7 @@ public class ADWindowContent extends AbstractADWindowContent
protected Component doCreatePart(Component parent)
{
layout = new Borderlayout();
layout = new Vlayout();
if (parent != null) {
layout.setParent(parent);
layout.setSclass("adwindow-layout");
@ -80,14 +77,13 @@ public class ADWindowContent extends AbstractADWindowContent
}
//toolbar
North n = new North();
n.setParent(layout);
n.setCollapsible(false);
n.setSclass("adwindow-north");
Div north = new Div();
north.setParent(layout);
north.setSclass("adwindow-north");
Div div = new Div();
div.setHflex("1");
div.setVflex("1");
n.appendChild(div);
div.setStyle("height: 100%; width: 100%");
north.appendChild(div);
north.setVflex("0");
toolbar.setParent(div);
toolbar.setWindowNo(getWindowNo());
breadCrumb = new BreadCrumb(getWindowNo());
@ -96,18 +92,21 @@ public class ADWindowContent extends AbstractADWindowContent
div.appendChild(breadCrumb);
//status bar
South s = new South();
layout.appendChild(s);
s.setCollapsible(false);
s.setSclass("adwindow-south");
statusBar.setParent(s);
Div south = new Div();
south.setSclass("adwindow-south");
south.setVflex("0");
statusBar.setParent(south);
LayoutUtils.addSclass("adwindow-status", statusBar);
contentArea = new Center();
contentArea = new Div();
contentArea.setParent(layout);
contentArea.setAutoscroll(true);
contentArea.setVflex("1");
contentArea.setHflex("1");
contentArea.setStyle("overflow: auto;");
adTabbox.createPart(contentArea);
layout.appendChild(south);
if (parent instanceof Tabpanel) {
TabOnCloseHanlder handler = new TabOnCloseHanlder();
@ -132,7 +131,7 @@ public class ADWindowContent extends AbstractADWindowContent
return composite;
}
public Borderlayout getComponent() {
public Vlayout getComponent() {
return layout;
}

View File

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

View File

@ -106,6 +106,8 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
addEventListener(LayoutUtils.ON_REDRAW_EVENT, this);
addEventListener("onPostInit", this);
setId("detailPane");
}
@ -405,6 +407,13 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
return;
}
LayoutUtils.redraw(this);
} else if (event.getName().equals("onPostInit")) {
IADTabpanel adtabpanel = getSelectedADTabpanel();
if (adtabpanel != null) {
GridView gridView = adtabpanel.getGridView();
if (gridView != null && gridView.getListbox() != null)
Clients.resize(gridView.getListbox());
}
}
}

View File

@ -267,10 +267,17 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
}
.menu-search-panel .z-comboitem-img {
vertical-align:top;
padding-bottom:4px;
}
.z-comboitem-img {
vertical-align:top;
}
.z-combobox input {
vertical-align:top;
}
.menu-panel .z-toolbar-panel {
padding-right: 0;
}
@ -477,16 +484,18 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
}
.adwindow-north {
height: 56px;
width: 100%;
padding: 0px;
margin: 0px;
border: none;
border-bottom: 1px solid #C5C5C5 !important;
}
.adwindow-south {
border-left: none;
border-right: none;
}
.adwindow-layout .z-south {
height: 20px;
width: 100%;
padding: 0px;
margin: 0px;
border-top: 1px solid #C5C5C5 !important;
}
@ -497,12 +506,15 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
.adwindow-toolbar {
border: 0px;
height: 26px;
}
.adwindow-breadcrumb {
height: 30px;
background-color: #FFF;
padding: 0px;
padding-left: 5px;
border-bottom: 1px solid #C5C5C5 !important;
}
.adwindow-detailpane {