IDEMPIERE-520 Master/Detail bugs found using Production window. Fixed regression after the 6.5.1 upgrade.

This commit is contained in:
Heng Sin Low 2013-01-12 00:08:08 +08:00
parent ae93d9ecc6
commit ebb76fd02c
6 changed files with 70 additions and 44 deletions

View File

@ -1226,18 +1226,20 @@ DataStatusListener, IADTabpanel, IdSpace
@Override @Override
public void setDetailPaneMode(boolean detailPaneMode) { public void setDetailPaneMode(boolean detailPaneMode) {
this.detailPaneMode = detailPaneMode; if (this.detailPaneMode != detailPaneMode) {
if (detailPaneMode) { this.detailPaneMode = detailPaneMode;
detailPane = null; if (detailPaneMode) {
if (formContainer instanceof Borderlayout) { detailPane = null;
Borderlayout borderLayout = (Borderlayout) formContainer; if (formContainer instanceof Borderlayout) {
if (borderLayout.getSouth() != null) { Borderlayout borderLayout = (Borderlayout) formContainer;
borderLayout.getSouth().detach(); if (borderLayout.getSouth() != null) {
borderLayout.getSouth().detach();
}
} }
} }
} this.setVflex("true");
this.setVflex("true"); listPanel.setDetailPaneMode(detailPaneMode);
listPanel.setDetailPaneMode(detailPaneMode); }
} }
/** /**

View File

@ -1399,7 +1399,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
} }
// //
adTabbox.evaluate(e); if (!detailTab)
{
adTabbox.evaluate(e);
}
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted()); toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted());
toolbar.enableReport(true); toolbar.enableReport(true);

View File

@ -318,11 +318,13 @@ public class CompositeADTabbox extends AbstractADTabbox
private void activateDetailADTabpanel() { private void activateDetailADTabpanel() {
if (detailPane != null && detailPane.getParent() != null) { if (detailPane != null && detailPane.getParent() != null) {
IADTabpanel tabPanel = detailPane.getSelectedADTabpanel(); IADTabpanel tabPanel = detailPane.getSelectedADTabpanel();
tabPanel.activate(true); if (tabPanel != null) {
if (!tabPanel.isGridView()) { tabPanel.activate(true);
tabPanel.switchRowPresentation(); if (!tabPanel.isGridView()) {
} tabPanel.switchRowPresentation();
}
}
} }
} }
@ -516,28 +518,29 @@ public class CompositeADTabbox extends AbstractADTabbox
} }
IADTabpanel detailTab = detailPane.getSelectedADTabpanel(); IADTabpanel detailTab = detailPane.getSelectedADTabpanel();
if (detailTab != null) {
//check data action //check data action
String uuid = (String) execution.getAttribute(CompositeADTabbox.class.getName()+".dataAction"); String uuid = (String) execution.getAttribute(CompositeADTabbox.class.getName()+".dataAction");
if (uuid != null && uuid.equals(detailTab.getUuid())) { if (uuid != null && uuid.equals(detailTab.getUuid())) {
//refresh current row //refresh current row
detailTab.getGridTab().dataRefresh(false); detailTab.getGridTab().dataRefresh(false);
//keep focus //keep focus
Clients.scrollIntoView(detailTab); Clients.scrollIntoView(detailTab);
return; return;
} }
GridTab tab = detailTab.getGridTab(); GridTab tab = detailTab.getGridTab();
GridField[] fields = tab.getFields(); GridField[] fields = tab.getFields();
for (GridField field : fields) for (GridField field : fields)
{ {
if (!parentColumnNames.contains(field.getColumnName())) if (!parentColumnNames.contains(field.getColumnName()))
Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), ""); Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), "");
} }
detailTab.activate(true); detailTab.activate(true);
detailTab.setDetailPaneMode(true); detailTab.setDetailPaneMode(true);
detailPane.setVflex("true"); }
detailPane.setVflex("true");
} }
} }

View File

@ -537,8 +537,12 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
Tab tab = (Tab) tabbox.getTabs().getChildren().get(i); Tab tab = (Tab) tabbox.getTabs().getChildren().get(i);
tab.setVisible(visible); tab.setVisible(visible);
if (tab.getLinkedPanel() != null) if (tab.isSelected()) {
tab.setSelected(false);
}
if (tab.getLinkedPanel() != null) {
tab.getLinkedPanel().setVisible(visible); tab.getLinkedPanel().setVisible(visible);
}
} }
public boolean isTabVisible(int i) { public boolean isTabVisible(int i) {

View File

@ -167,9 +167,11 @@ public class GridView extends Vbox implements EventListener<Event>, IdSpace
} }
public void setDetailPaneMode(boolean detailPaneMode) { public void setDetailPaneMode(boolean detailPaneMode) {
this.detailPaneMode = detailPaneMode; if (this.detailPaneMode != detailPaneMode) {
pageSize = detailPaneMode ? DEFAULT_DETAIL_PAGE_SIZE : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20); this.detailPaneMode = detailPaneMode;
updatePaging(); pageSize = detailPaneMode ? DEFAULT_DETAIL_PAGE_SIZE : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20);
updatePaging();
}
} }
public boolean isDetailPaneMode() { public boolean isDetailPaneMode() {

View File

@ -45,7 +45,19 @@ public class Tabpanel extends org.zkoss.zul.Tabpanel implements IdSpace
return enabled; return enabled;
} }
public void setEnabled(boolean enabled) @Override
public boolean setVisible(boolean visible) {
// TODO Auto-generated method stub
return super.setVisible(visible);
}
@Override
protected void setVisibleDirectly(boolean visible) {
// TODO Auto-generated method stub
super.setVisibleDirectly(visible);
}
public void setEnabled(boolean enabled)
{ {
this.enabled = enabled; this.enabled = enabled;
} }