This commit is contained in:
Deepak Pansheriya 2012-10-02 22:32:19 +05:30
commit 21827d38cc
3 changed files with 17 additions and 6 deletions

View File

@ -2534,11 +2534,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
gridFieldIds.add(fields[i].getAD_Field_ID()); gridFieldIds.add(fields[i].getAD_Field_ID());
} }
if (CustomizeGridViewDialog.showCustomize(0, curTab.getAD_Tab_ID(), columnsWidth,gridFieldIds)) {
if (tabPanel.getGridView() != null) { CustomizeGridViewDialog.showCustomize(0, curTab.getAD_Tab_ID(), columnsWidth,gridFieldIds,tabPanel.getGridView());
tabPanel.getGridView().reInit();
}
}
} }
} }

View File

@ -29,6 +29,7 @@ import java.util.logging.Level;
import org.adempiere.model.MTabCustomization; import org.adempiere.model.MTabCustomization;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.GridPanel;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ListHead; import org.adempiere.webui.component.ListHead;
import org.adempiere.webui.component.ListHeader; import org.adempiere.webui.component.ListHeader;
@ -67,6 +68,7 @@ public class CustomizeGridViewPanel extends Panel
private static final long serialVersionUID = 4289328613547509587L; private static final long serialVersionUID = 4289328613547509587L;
private Map<Integer, String> m_columnsWidth; private Map<Integer, String> m_columnsWidth;
ArrayList<Integer> tableSeqs; ArrayList<Integer> tableSeqs;
GridPanel gridPanel = null;
/** /**
* Sort Tab Constructor * Sort Tab Constructor
* *
@ -562,6 +564,9 @@ public class CustomizeGridViewPanel extends Panel
m_saved = true; m_saved = true;
FDialog.info(m_WindowNo, null, "Saved"); FDialog.info(m_WindowNo, null, "Saved");
getParent().detach(); getParent().detach();
if(gridPanel!=null){
gridPanel.reInit();
}
} else { } else {
FDialog.error(m_WindowNo, null, "SaveError", custom.toString()); FDialog.error(m_WindowNo, null, "SaveError", custom.toString());
} }
@ -760,5 +765,8 @@ public class CustomizeGridViewPanel extends Panel
public boolean isSaved() { public boolean isSaved() {
return m_saved; return m_saved;
} }
public void setGridPanel(GridPanel gridPanel){
this.gridPanel = gridPanel;
}
} //ADSortTab } //ADSortTab

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Map; import java.util.Map;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.GridPanel;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.panel.CustomizeGridViewPanel; import org.adempiere.webui.panel.CustomizeGridViewPanel;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -50,15 +51,20 @@ public class CustomizeGridViewDialog extends Window {
return customizePanel.isSaved(); return customizePanel.isSaved();
} }
public void setGridPanel(GridPanel gridPanel){
customizePanel.setGridPanel(gridPanel);
}
/** /**
* Show User customize (modal) * Show User customize (modal)
* @param WindowNo window no * @param WindowNo window no
* @param AD_Tab_ID * @param AD_Tab_ID
* @param columnsWidth * @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); CustomizeGridViewDialog customizeWindow = new CustomizeGridViewDialog(WindowNo, AD_Tab_ID, Env.getAD_User_ID(Env.getCtx()), columnsWidth,gridFieldIds);
customizeWindow.setGridPanel(gridPanel);
AEnv.showWindow(customizeWindow); AEnv.showWindow(customizeWindow);
return customizeWindow.isSaved(); return customizeWindow.isSaved();
} // showProduct } // showProduct