Idempiere-364 Fixing grid refreshing issue after customization.

This commit is contained in:
Deepak Pansheriya 2012-09-13 17:26:05 +05:30
parent cdf2d1ef07
commit da2893b14e
3 changed files with 17 additions and 6 deletions

View File

@ -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();
}
}
}
}

View File

@ -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<Integer, String> m_columnsWidth;
ArrayList<Integer> 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

View File

@ -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<Integer, String> columnsWidth,ArrayList<Integer> gridFieldIds)
public static boolean showCustomize (int WindowNo, int AD_Tab_ID, Map<Integer, String> columnsWidth,ArrayList<Integer> 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