IDEMPIERE-4005 Force grid mode when Find panel closes

This commit is contained in:
Nicolas Micoud 2019-09-03 14:27:44 +02:00
parent 12e9d47c74
commit 63fab58fc1
6 changed files with 238 additions and 3 deletions

View File

@ -0,0 +1,70 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4005 : Force grid mode when Find panel closes
-- Jul 10, 2019, 10:30:08 AM 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 (200152,0,0,TO_DATE('2019-07-10 10:30:08','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2019-07-10 10:30:08','YYYY-MM-DD HH24:MI:SS'),0,0,'Y','ZK_GRID_AFTER_FIND','N','The display mode can swith automatically on grid when the find panel closes','D','C','d3d69e9a-47d8-4fe8-80e6-564af031f9e5')
;
-- Jul 10, 2019, 10:30:36 AM CEST
INSERT INTO AD_Reference (AD_Reference_ID,Name,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU) VALUES (200170,'ViewFindResult','L',0,0,'Y',TO_DATE('2019-07-10 10:30:35','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:30:35','YYYY-MM-DD HH24:MI:SS'),0,'D','N','718b69d3-4b62-4d7d-a137-470e4e272052')
;
-- Jul 10, 2019, 10:30:51 AM CEST
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,Description,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200474,'Default','Use what is defined on the Sysconfig key',200170,'0',0,0,'Y',TO_DATE('2019-07-10 10:30:50','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:30:50','YYYY-MM-DD HH24:MI:SS'),0,'D','f4ec3670-1ae8-4442-afb3-c74d2df7a06e')
;
-- Jul 10, 2019, 10:30:59 AM CEST
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200475,'Always in Grid View',200170,'1',0,0,'Y',TO_DATE('2019-07-10 10:30:59','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:30:59','YYYY-MM-DD HH24:MI:SS'),0,'D','ca0109d2-766d-4123-832c-f614c8c52ef2')
;
-- Jul 10, 2019, 10:31:07 AM CEST
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200476,'According to threshold',200170,'2',0,0,'Y',TO_DATE('2019-07-10 10:31:07','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:31:07','YYYY-MM-DD HH24:MI:SS'),0,'D','a81e98ac-ddae-410c-8a20-d447ceed5486')
;
-- Jul 10, 2019, 10:31:26 AM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203345,0,0,'Y',TO_DATE('2019-07-10 10:31:26','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:31:26','YYYY-MM-DD HH24:MI:SS'),0,'ViewFindResult','View find result','Does the system must switch to grid mode after the Find panel closes','View find result','D','d9def948-0c09-46cb-800b-b5937bb8bec3')
;
-- Jul 10, 2019, 10:31:39 AM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203346,0,0,'Y',TO_DATE('2019-07-10 10:31:39','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:31:39','YYYY-MM-DD HH24:MI:SS'),0,'GridAfterFindThreshold','Threshold','Force grid view when Find panel closes if number of records exceed threshold','Threshold','D','4a809a40-c995-4f36-a6cb-2859ca2fa345')
;
-- Jul 10, 2019, 10:32:08 AM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Reference_Value_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (213965,0,'View find result','Does the system must switch to grid mode after the Find panel closes',200174,'ViewFindResult','0',1,'N','N','Y','N','N',0,'N',17,200170,0,0,'Y',TO_DATE('2019-07-10 10:32:07','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:32:07','YYYY-MM-DD HH24:MI:SS'),0,203345,'Y','N','D','N','N','N','Y','d66b873b-9544-4298-94d3-883751355b8d','N',0,'N','N','N','N')
;
-- Jul 10, 2019, 10:32:09 AM CEST
ALTER TABLE AD_UserPreference ADD ViewFindResult CHAR(1) DEFAULT '0' NOT NULL
;
-- Jul 10, 2019, 10:32:30 AM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,MandatoryLogic,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (213966,0,'Threshold','Force grid view when Find panel closes if number of records exceed threshold',200174,'GridAfterFindThreshold',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_DATE('2019-07-10 10:32:30','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:32:30','YYYY-MM-DD HH24:MI:SS'),0,203346,'Y','N','U','N','N','@ViewFindResult@ = 2','N','Y','ebc023d1-3d96-4761-ba09-39db3da385c0','N',0,'N','N','N','N')
;
-- Jul 10, 2019, 10:32:31 AM CEST
ALTER TABLE AD_UserPreference ADD GridAfterFindThreshold NUMBER(10) DEFAULT NULL
;
-- Jul 10, 2019, 10:32:35 AM CEST
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2019-07-10 10:32:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=213966
;
-- Jul 10, 2019, 10:33:18 AM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206133,'View find result','Does the system must switch to grid mode after the Find panel closes',200189,213965,'Y',1,130,'N','N','N','N',0,0,'Y',TO_DATE('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','c3637c90-40dd-42f3-8248-b47b4b97491e','Y',130,2)
;
-- Jul 10, 2019, 10:33:18 AM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206134,'Threshold','Force grid view when Find panel closes if number of records exceed threshold',200189,213966,'Y',10,140,'N','N','N','N',0,0,'Y',TO_DATE('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','eafb72af-6375-4b17-830a-c19ddecc56a3','Y',140,2)
;
-- Jul 10, 2019, 10:33:28 AM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_DATE('2019-07-10 10:33:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206134
;
-- Jul 10, 2019, 10:33:46 AM CEST
UPDATE AD_Field SET DisplayLogic='@ViewFindResult@ = 2', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2019-07-10 10:33:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206134
;
SELECT register_migration_script('201907101055_IDEMPIERE-4005.sql') FROM dual
;

View File

@ -0,0 +1,67 @@
-- IDEMPIERE-4005 : Force grid mode when Find panel closes
-- Jul 10, 2019, 10:30:08 AM 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 (200152,0,0,TO_TIMESTAMP('2019-07-10 10:30:08','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2019-07-10 10:30:08','YYYY-MM-DD HH24:MI:SS'),0,0,'Y','ZK_GRID_AFTER_FIND','N','The display mode can swith automatically on grid when the find panel closes','D','C','d3d69e9a-47d8-4fe8-80e6-564af031f9e5')
;
-- Jul 10, 2019, 10:30:36 AM CEST
INSERT INTO AD_Reference (AD_Reference_ID,Name,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU) VALUES (200170,'ViewFindResult','L',0,0,'Y',TO_TIMESTAMP('2019-07-10 10:30:35','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:30:35','YYYY-MM-DD HH24:MI:SS'),0,'D','N','718b69d3-4b62-4d7d-a137-470e4e272052')
;
-- Jul 10, 2019, 10:30:51 AM CEST
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,Description,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200474,'Default','Use what is defined on the Sysconfig key',200170,'0',0,0,'Y',TO_TIMESTAMP('2019-07-10 10:30:50','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:30:50','YYYY-MM-DD HH24:MI:SS'),0,'D','f4ec3670-1ae8-4442-afb3-c74d2df7a06e')
;
-- Jul 10, 2019, 10:30:59 AM CEST
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200475,'Always in Grid View',200170,'1',0,0,'Y',TO_TIMESTAMP('2019-07-10 10:30:59','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:30:59','YYYY-MM-DD HH24:MI:SS'),0,'D','ca0109d2-766d-4123-832c-f614c8c52ef2')
;
-- Jul 10, 2019, 10:31:07 AM CEST
INSERT INTO AD_Ref_List (AD_Ref_List_ID,Name,AD_Reference_ID,Value,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Ref_List_UU) VALUES (200476,'According to threshold',200170,'2',0,0,'Y',TO_TIMESTAMP('2019-07-10 10:31:07','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:31:07','YYYY-MM-DD HH24:MI:SS'),0,'D','a81e98ac-ddae-410c-8a20-d447ceed5486')
;
-- Jul 10, 2019, 10:31:26 AM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203345,0,0,'Y',TO_TIMESTAMP('2019-07-10 10:31:26','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:31:26','YYYY-MM-DD HH24:MI:SS'),0,'ViewFindResult','View find result','Does the system must switch to grid mode after the Find panel closes','View find result','D','d9def948-0c09-46cb-800b-b5937bb8bec3')
;
-- Jul 10, 2019, 10:31:39 AM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203346,0,0,'Y',TO_TIMESTAMP('2019-07-10 10:31:39','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:31:39','YYYY-MM-DD HH24:MI:SS'),0,'GridAfterFindThreshold','Threshold','Force grid view when Find panel closes if number of records exceed threshold','Threshold','D','4a809a40-c995-4f36-a6cb-2859ca2fa345')
;
-- Jul 10, 2019, 10:32:08 AM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Reference_Value_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (213965,0,'View find result','Does the system must switch to grid mode after the Find panel closes',200174,'ViewFindResult','0',1,'N','N','Y','N','N',0,'N',17,200170,0,0,'Y',TO_TIMESTAMP('2019-07-10 10:32:07','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:32:07','YYYY-MM-DD HH24:MI:SS'),0,203345,'Y','N','D','N','N','N','Y','d66b873b-9544-4298-94d3-883751355b8d','N',0,'N','N','N','N')
;
-- Jul 10, 2019, 10:32:09 AM CEST
ALTER TABLE AD_UserPreference ADD COLUMN ViewFindResult CHAR(1) DEFAULT '0' NOT NULL
;
-- Jul 10, 2019, 10:32:30 AM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,MandatoryLogic,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (213966,0,'Threshold','Force grid view when Find panel closes if number of records exceed threshold',200174,'GridAfterFindThreshold',10,'N','N','N','N','N',0,'N',11,0,0,'Y',TO_TIMESTAMP('2019-07-10 10:32:30','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:32:30','YYYY-MM-DD HH24:MI:SS'),0,203346,'Y','N','U','N','N','@ViewFindResult@ = 2','N','Y','ebc023d1-3d96-4761-ba09-39db3da385c0','N',0,'N','N','N','N')
;
-- Jul 10, 2019, 10:32:31 AM CEST
ALTER TABLE AD_UserPreference ADD COLUMN GridAfterFindThreshold NUMERIC(10) DEFAULT NULL
;
-- Jul 10, 2019, 10:32:35 AM CEST
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2019-07-10 10:32:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=213966
;
-- Jul 10, 2019, 10:33:18 AM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206133,'View find result','Does the system must switch to grid mode after the Find panel closes',200189,213965,'Y',1,130,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','c3637c90-40dd-42f3-8248-b47b4b97491e','Y',130,2)
;
-- Jul 10, 2019, 10:33:18 AM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (206134,'Threshold','Force grid view when Find panel closes if number of records exceed threshold',200189,213966,'Y',10,140,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2019-07-10 10:33:18','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','eafb72af-6375-4b17-830a-c19ddecc56a3','Y',140,2)
;
-- Jul 10, 2019, 10:33:28 AM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=4, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-07-10 10:33:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206134
;
-- Jul 10, 2019, 10:33:46 AM CEST
UPDATE AD_Field SET DisplayLogic='@ViewFindResult@ = 2', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2019-07-10 10:33:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206134
;
SELECT register_migration_script('201907101055_IDEMPIERE-4005.sql') FROM dual
;

View File

@ -142,6 +142,19 @@ public interface I_AD_UserPreference
*/
public int getCreatedBy();
/** Column name GridAfterFindThreshold */
public static final String COLUMNNAME_GridAfterFindThreshold = "GridAfterFindThreshold";
/** Set Threshold.
* Force grid view when Find panel closes if number of records exceed threshold
*/
public void setGridAfterFindThreshold (int GridAfterFindThreshold);
/** Get Threshold.
* Force grid view when Find panel closes if number of records exceed threshold
*/
public int getGridAfterFindThreshold();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
@ -201,4 +214,17 @@ public interface I_AD_UserPreference
* User who updated this records
*/
public int getUpdatedBy();
/** Column name ViewFindResult */
public static final String COLUMNNAME_ViewFindResult = "ViewFindResult";
/** Set View find result.
* Does the system must switch to grid mode after the Find panel closes
*/
public void setViewFindResult (String ViewFindResult);
/** Get View find result.
* Does the system must switch to grid mode after the Find panel closes
*/
public String getViewFindResult();
}

View File

@ -42,7 +42,7 @@ public class MSysConfig extends X_AD_SysConfig
/**
*
*/
private static final long serialVersionUID = -3144528502974306817L;
private static final long serialVersionUID = 6662424546913925975L;
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
@ -171,6 +171,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String ZK_DESKTOP_CLASS = "ZK_DESKTOP_CLASS";
public static final String ZK_FOOTER_SERVER_DATETIME_FORMAT = "ZK_FOOTER_SERVER_DATETIME_FORMAT";
public static final String ZK_FOOTER_SERVER_MSG = "ZK_FOOTER_SERVER_MSG";
public static final String ZK_GRID_AFTER_FIND = "ZK_GRID_AFTER_FIND";
public static final String ZK_GRID_EDIT_MODELESS = "ZK_GRID_EDIT_MODELESS";
public static final String ZK_GRID_MOBILE_EDIT_MODELESS = "ZK_GRID_MOBILE_EDIT_MODELESS";
public static final String ZK_GRID_MOBILE_MAX_COLUMNS = "ZK_GRID_MOBILE_MAX_COLUMNS";

View File

@ -29,7 +29,7 @@ public class X_AD_UserPreference extends PO implements I_AD_UserPreference, I_Pe
/**
*
*/
private static final long serialVersionUID = 20190106L;
private static final long serialVersionUID = 20190710L;
/** Standard Constructor */
public X_AD_UserPreference (Properties ctx, int AD_UserPreference_ID, String trxName)
@ -39,6 +39,8 @@ public class X_AD_UserPreference extends PO implements I_AD_UserPreference, I_Pe
{
setAD_User_ID (0);
setAD_UserPreference_ID (0);
setViewFindResult (null);
// 0
} */
}
@ -194,6 +196,26 @@ public class X_AD_UserPreference extends PO implements I_AD_UserPreference, I_Pe
return false;
}
/** Set Threshold.
@param GridAfterFindThreshold
Force grid view when Find panel closes if number of records exceed threshold
*/
public void setGridAfterFindThreshold (int GridAfterFindThreshold)
{
set_Value (COLUMNNAME_GridAfterFindThreshold, Integer.valueOf(GridAfterFindThreshold));
}
/** Get Threshold.
@return Force grid view when Find panel closes if number of records exceed threshold
*/
public int getGridAfterFindThreshold ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_GridAfterFindThreshold);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Detailed Zoom Across.
@param IsDetailedZoomAcross Detailed Zoom Across */
public void setIsDetailedZoomAcross (boolean IsDetailedZoomAcross)
@ -259,4 +281,30 @@ public class X_AD_UserPreference extends PO implements I_AD_UserPreference, I_Pe
}
return false;
}
/** ViewFindResult AD_Reference_ID=200170 */
public static final int VIEWFINDRESULT_AD_Reference_ID=200170;
/** Default = 0 */
public static final String VIEWFINDRESULT_Default = "0";
/** Always in Grid View = 1 */
public static final String VIEWFINDRESULT_AlwaysInGridView = "1";
/** According to threshold = 2 */
public static final String VIEWFINDRESULT_AccordingToThreshold = "2";
/** Set View find result.
@param ViewFindResult
Does the system must switch to grid mode after the Find panel closes
*/
public void setViewFindResult (String ViewFindResult)
{
set_Value (COLUMNNAME_ViewFindResult, ViewFindResult);
}
/** Get View find result.
@return Does the system must switch to grid mode after the Find panel closes
*/
public String getViewFindResult ()
{
return (String)get_Value(COLUMNNAME_ViewFindResult);
}
}

View File

@ -19,6 +19,7 @@ package org.adempiere.webui.adwindow;
import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_REDO;
import static org.compiere.model.SystemIDs.PROCESS_AD_CHANGELOG_UNDO;
import static org.compiere.model.MSysConfig.ZK_GRID_AFTER_FIND;
import java.text.MessageFormat;
import java.util.ArrayList;
@ -93,6 +94,8 @@ import org.compiere.model.MProjectIssue;
import org.compiere.model.MQuery;
import org.compiere.model.MRecentItem;
import org.compiere.model.MRole;
import org.compiere.model.MSysConfig;
import org.compiere.model.MUserPreference;
import org.compiere.model.MWindow;
import org.compiere.model.PO;
import org.compiere.model.X_AD_CtxHelp;
@ -2060,8 +2063,28 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (findWindow.isCreateNew())
onNew();
else
else {
adTabbox.getSelectedGridTab().dataRefresh(false); // Elaine 2008/07/25
if (!adTabbox.getSelectedTabpanel().isGridView()) { // See if we should force the grid view
boolean forceGridView = false;
String up = Env.getContext(Env.getCtx(), MUserPreference.COLUMNNAME_ViewFindResult);
if (up.equals(MUserPreference.VIEWFINDRESULT_Default)) {
forceGridView = MSysConfig.getBooleanValue(ZK_GRID_AFTER_FIND, false, Env.getAD_Client_ID(Env.getCtx()));
}
else if (up.equals(MUserPreference.VIEWFINDRESULT_AlwaysInGridView)) {
forceGridView = true;
}
else if (up.equals(MUserPreference.VIEWFINDRESULT_AccordingToThreshold)) {
forceGridView = adTabbox.getSelectedTabpanel().getGridTab().getRowCount() >= Env.getContextAsInt(Env.getCtx(), MUserPreference.COLUMNNAME_GridAfterFindThreshold);
}
if (forceGridView)
adTabbox.getSelectedTabpanel().switchRowPresentation();
}
}
}
else
{