diff --git a/migration/i6.1/oracle/201809111630_IDEMPIERE-3786.sql b/migration/i6.1/oracle/201809111630_IDEMPIERE-3786.sql new file mode 100644 index 0000000000..27b174ee52 --- /dev/null +++ b/migration/i6.1/oracle/201809111630_IDEMPIERE-3786.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3786 : Number of records in detail grid must not be hardcoded +-- Sep 11, 2018 4:29:18 PM CEST +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200143,0,0,TO_DATE('2018-09-11 16:29:17','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2018-09-11 16:29:17','YYYY-MM-DD HH24:MI:SS'),0,0,'Y','ZK_PAGING_DETAIL_SIZE','10','Default paging size for detail grid view in zk webui','D','C','e4555557-68a2-4b87-a605-4da79de87644') +; + +SELECT register_migration_script('201809111630_IDEMPIERE-3786.sql') FROM dual +; diff --git a/migration/i6.1/postgresql/201809111630_IDEMPIERE-3786.sql b/migration/i6.1/postgresql/201809111630_IDEMPIERE-3786.sql new file mode 100644 index 0000000000..d5f4e72c36 --- /dev/null +++ b/migration/i6.1/postgresql/201809111630_IDEMPIERE-3786.sql @@ -0,0 +1,7 @@ +-- IDEMPIERE-3786 : Number of records in detail grid must not be hardcoded +-- Sep 11, 2018 4:29:18 PM CEST +INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200143,0,0,TO_TIMESTAMP('2018-09-11 16:29:17','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2018-09-11 16:29:17','YYYY-MM-DD HH24:MI:SS'),0,0,'Y','ZK_PAGING_DETAIL_SIZE','10','Default paging size for detail grid view in zk webui','D','C','e4555557-68a2-4b87-a605-4da79de87644') +; + +SELECT register_migration_script('201809111630_IDEMPIERE-3786.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 77bcaf5a63..712c77ed8c 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -42,9 +42,9 @@ public class MSysConfig extends X_AD_SysConfig /** * */ - private static final long serialVersionUID = 8623809160538454497L; + private static final long serialVersionUID = -1273442365045945366L; - public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; + public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION"; public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS"; public static final String ALLOCATION_DESCRIPTION = "ALLOCATION_DESCRIPTION"; public static final String ALLOW_APPLY_PAYMENT_TO_CREDITMEMO = "ALLOW_APPLY_PAYMENT_TO_CREDITMEMO"; @@ -59,7 +59,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String APPLICATION_MAIN_VERSION = "APPLICATION_MAIN_VERSION"; public static final String APPLICATION_MAIN_VERSION_SHOWN = "APPLICATION_MAIN_VERSION_SHOWN"; public static final String APPLICATION_OS_INFO_SHOWN = "APPLICATION_OS_INFO_SHOWN"; - public static final String APPLICATION_URL = "APPLICATION_URL"; + public static final String APPLICATION_URL = "APPLICATION_URL"; public static final String ATTACH_EMBEDDED_2PACK = "ATTACH_EMBEDDED_2PACK"; public static final String AUTO_ASSIGN_ROLE_TO_CREATOR_USER = "AUTO_ASSIGN_ROLE_TO_CREATOR_USER"; public static final String AUTOMATIC_PACKIN_FOLDERS = "AUTOMATIC_PACKIN_FOLDERS"; @@ -141,7 +141,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String SYSTEM_IN_MAINTENANCE_MODE = "SYSTEM_IN_MAINTENANCE_MODE"; public static final String SYSTEM_INSERT_CHANGELOG = "SYSTEM_INSERT_CHANGELOG"; public static final String SYSTEM_NATIVE_SEQUENCE = "SYSTEM_NATIVE_SEQUENCE"; - public static final String TOP_MARGIN_PIXELS_FOR_HEADER = "TOP_MARGIN_PIXELS_FOR_HEADER"; + public static final String TOP_MARGIN_PIXELS_FOR_HEADER = "TOP_MARGIN_PIXELS_FOR_HEADER"; public static final String TRACE_ALL_TRX_CONNECTION_GET = "TRACE_ALL_TRX_CONNECTION_GET"; public static final String TWOPACK_COMMIT_DDL = "2PACK_COMMIT_DDL"; public static final String TWOPACK_HANDLE_TRANSLATIONS = "2PACK_HANDLE_TRANSLATIONS"; @@ -175,6 +175,7 @@ public class MSysConfig extends X_AD_SysConfig public static final String ZK_LOGO_SMALL = "ZK_LOGO_SMALL"; public static final String ZK_MAX_UPLOAD_SIZE = "ZK_MAX_UPLOAD_SIZE"; public static final String ZK_MOBILE_PAGING_SIZE = "ZK_MOBILE_PAGING_SIZE"; + public static final String ZK_PAGING_DETAIL_SIZE = "ZK_PAGING_DETAIL_SIZE"; public static final String ZK_PAGING_SIZE = "ZK_PAGING_SIZE"; public static final String ZK_REPORT_FORM_OUTPUT_TYPE = "ZK_REPORT_FORM_OUTPUT_TYPE"; public static final String ZK_REPORT_JASPER_OUTPUT_TYPE = "ZK_REPORT_JASPER_OUTPUT_TYPE"; @@ -183,8 +184,8 @@ public class MSysConfig extends X_AD_SysConfig public static final String ZK_ROOT_FOLDER_BROWSER = "ZK_ROOT_FOLDER_BROWSER"; public static final String ZK_SEQ_DEFAULT_VALUE_PANEL = "ZK_SEQ_DEFAULT_VALUE_PANEL"; public static final String ZK_SESSION_TIMEOUT_IN_SECONDS = "ZK_SESSION_TIMEOUT_IN_SECONDS"; - public static final String ZK_THEME = "ZK_THEME"; public static final String ZK_THEME_USE_FONT_ICON_FOR_IMAGE = "ZK_THEME_USE_FONT_ICON_FOR_IMAGE"; + public static final String ZK_THEME = "ZK_THEME"; public static final String ZOOM_ACROSS_QUERY_TIMEOUT = "ZOOM_ACROSS_QUERY_TIMEOUT"; /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index b9ca3e3c25..5d1671a4c5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -78,7 +78,7 @@ public class GridView extends Vlayout implements EventListener, IdSpace, /** * */ - private static final long serialVersionUID = -2966799998482667434L; + private static final long serialVersionUID = 3046157124327495333L; private static final String HEADER_GRID_STYLE = "border: none; margin:0; padding: 0;"; @@ -208,11 +208,16 @@ public class GridView extends Vlayout implements EventListener, IdSpace, public void setDetailPaneMode(boolean detailPaneMode) { if (this.detailPaneMode != detailPaneMode) { this.detailPaneMode = detailPaneMode; - pageSize = detailPaneMode ? DEFAULT_DETAIL_PAGE_SIZE : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20, Env.getAD_Client_ID(Env.getCtx())); + pageSize = detailPaneMode ? getDetailPageSize() : MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 20, Env.getAD_Client_ID(Env.getCtx())); updatePaging(); } } + /** Returns the number of records to be displayed in detail grid (TODO : manage exceptions defined in SysConfig - see https://idempiere.atlassian.net/browse/IDEMPIERE-3786) */ + int getDetailPageSize() { + return MSysConfig.getIntValue(MSysConfig.ZK_PAGING_DETAIL_SIZE, DEFAULT_DETAIL_PAGE_SIZE, Env.getAD_Client_ID(Env.getCtx())); + } + public boolean isDetailPaneMode() { return this.detailPaneMode; }