From da2893b14ed0c1f19e1dc0dfd2191089fc2cc36d Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Thu, 13 Sep 2012 17:26:05 +0530 Subject: [PATCH] Idempiere-364 Fixing grid refreshing issue after customization. --- .../org/adempiere/webui/panel/AbstractADWindowPanel.java | 7 ++----- .../org/adempiere/webui/panel/CustomizeGridViewPanel.java | 8 ++++++++ .../adempiere/webui/window/CustomizeGridViewDialog.java | 8 +++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index a5d7d12311..14c3946950 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -2533,11 +2533,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To gridFieldIds.add(fields[i].getAD_Field_ID()); } - if (CustomizeGridViewDialog.showCustomize(0, curTab.getAD_Tab_ID(), columnsWidth,gridFieldIds)) { + + CustomizeGridViewDialog.showCustomize(0, curTab.getAD_Tab_ID(), columnsWidth,gridFieldIds,tabPanel.getGridView()); - if (tabPanel.getGridView() != null) { - tabPanel.getGridView().reInit(); - } - } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java index 965a1ed618..e64778291f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java @@ -29,6 +29,7 @@ import java.util.logging.Level; import org.adempiere.model.MTabCustomization; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Checkbox; +import org.adempiere.webui.component.GridPanel; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.ListHead; import org.adempiere.webui.component.ListHeader; @@ -67,6 +68,7 @@ public class CustomizeGridViewPanel extends Panel private static final long serialVersionUID = 4289328613547509587L; private Map m_columnsWidth; ArrayList tableSeqs; + GridPanel gridPanel = null; /** * Sort Tab Constructor * @@ -562,6 +564,9 @@ public class CustomizeGridViewPanel extends Panel m_saved = true; FDialog.info(m_WindowNo, null, "Saved"); getParent().detach(); + if(gridPanel!=null){ + gridPanel.reInit(); + } } else { FDialog.error(m_WindowNo, null, "SaveError", custom.toString()); } @@ -760,5 +765,8 @@ public class CustomizeGridViewPanel extends Panel public boolean isSaved() { return m_saved; } + public void setGridPanel(GridPanel gridPanel){ + this.gridPanel = gridPanel; + } } //ADSortTab diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java index 7f2d006827..cc0623ec13 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/CustomizeGridViewDialog.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Map; import org.adempiere.webui.apps.AEnv; +import org.adempiere.webui.component.GridPanel; import org.adempiere.webui.component.Window; import org.adempiere.webui.panel.CustomizeGridViewPanel; import org.compiere.util.Env; @@ -49,6 +50,10 @@ public class CustomizeGridViewDialog extends Window { public boolean isSaved() { return customizePanel.isSaved(); } + + public void setGridPanel(GridPanel gridPanel){ + customizePanel.setGridPanel(gridPanel); + } /** * Show User customize (modal) @@ -56,9 +61,10 @@ public class CustomizeGridViewDialog extends Window { * @param AD_Tab_ID * @param columnsWidth */ - public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map columnsWidth,ArrayList gridFieldIds) + public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map columnsWidth,ArrayList gridFieldIds,GridPanel gridPanel) { CustomizeGridViewDialog customizeWindow = new CustomizeGridViewDialog(WindowNo, AD_Tab_ID, Env.getAD_User_ID(Env.getCtx()), columnsWidth,gridFieldIds); + customizeWindow.setGridPanel(gridPanel); AEnv.showWindow(customizeWindow); return customizeWindow.isSaved(); } // showProduct