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
public void setDetailPaneMode(boolean detailPaneMode) {
this.detailPaneMode = detailPaneMode;
if (detailPaneMode) {
detailPane = null;
if (formContainer instanceof Borderlayout) {
Borderlayout borderLayout = (Borderlayout) formContainer;
if (borderLayout.getSouth() != null) {
borderLayout.getSouth().detach();
if (this.detailPaneMode != detailPaneMode) {
this.detailPaneMode = detailPaneMode;
if (detailPaneMode) {
detailPane = null;
if (formContainer instanceof Borderlayout) {
Borderlayout borderLayout = (Borderlayout) formContainer;
if (borderLayout.getSouth() != null) {
borderLayout.getSouth().detach();
}
}
}
}
this.setVflex("true");
listPanel.setDetailPaneMode(detailPaneMode);
}
this.setVflex("true");
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.enableReport(true);

View File

@ -318,11 +318,13 @@ public class CompositeADTabbox extends AbstractADTabbox
private void activateDetailADTabpanel() {
if (detailPane != null && detailPane.getParent() != null) {
IADTabpanel tabPanel = detailPane.getSelectedADTabpanel();
tabPanel.activate(true);
if (!tabPanel.isGridView()) {
tabPanel.switchRowPresentation();
}
IADTabpanel tabPanel = detailPane.getSelectedADTabpanel();
if (tabPanel != null) {
tabPanel.activate(true);
if (!tabPanel.isGridView()) {
tabPanel.switchRowPresentation();
}
}
}
}
@ -516,28 +518,29 @@ public class CompositeADTabbox extends AbstractADTabbox
}
IADTabpanel detailTab = detailPane.getSelectedADTabpanel();
//check data action
String uuid = (String) execution.getAttribute(CompositeADTabbox.class.getName()+".dataAction");
if (uuid != null && uuid.equals(detailTab.getUuid())) {
//refresh current row
detailTab.getGridTab().dataRefresh(false);
//keep focus
Clients.scrollIntoView(detailTab);
return;
}
GridTab tab = detailTab.getGridTab();
GridField[] fields = tab.getFields();
for (GridField field : fields)
{
if (!parentColumnNames.contains(field.getColumnName()))
Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), "");
}
detailTab.activate(true);
detailTab.setDetailPaneMode(true);
detailPane.setVflex("true");
if (detailTab != null) {
//check data action
String uuid = (String) execution.getAttribute(CompositeADTabbox.class.getName()+".dataAction");
if (uuid != null && uuid.equals(detailTab.getUuid())) {
//refresh current row
detailTab.getGridTab().dataRefresh(false);
//keep focus
Clients.scrollIntoView(detailTab);
return;
}
GridTab tab = detailTab.getGridTab();
GridField[] fields = tab.getFields();
for (GridField field : fields)
{
if (!parentColumnNames.contains(field.getColumnName()))
Env.setContext(Env.getCtx(), field.getWindowNo(), field.getColumnName(), "");
}
detailTab.activate(true);
detailTab.setDetailPaneMode(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.setVisible(visible);
if (tab.getLinkedPanel() != null)
if (tab.isSelected()) {
tab.setSelected(false);
}
if (tab.getLinkedPanel() != null) {
tab.getLinkedPanel().setVisible(visible);
}
}
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) {
this.detailPaneMode = detailPaneMode;
pageSize = detailPaneMode ? DEFAULT_DETAIL_PAGE_SIZE : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20);
updatePaging();
if (this.detailPaneMode != detailPaneMode) {
this.detailPaneMode = detailPaneMode;
pageSize = detailPaneMode ? DEFAULT_DETAIL_PAGE_SIZE : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20);
updatePaging();
}
}
public boolean isDetailPaneMode() {

View File

@ -45,7 +45,19 @@ public class Tabpanel extends org.zkoss.zul.Tabpanel implements IdSpace
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;
}