IDEMPIERE-2488:Info Window run Query twice

add option load page number or not
This commit is contained in:
hieplq 2015-08-10 00:15:14 +08:00
parent f75ed55e93
commit bdeb9727be
6 changed files with 216 additions and 4 deletions

View File

@ -0,0 +1,72 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
-- Aug 9, 2015 11:42:05 PM WITA
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (1000000,0,0,'Y',TO_DATE('2015-08-09 23:42:05','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-08-09 23:42:05','YYYY-MM-DD HH24:MI:SS'),100,'isLoadPageNum','Load Page Num','When load data for info window, also load number of paging','Load number of paging maybe affect to performance when info window is join of many table','Load Page Num','D','9ac2b88f-7ada-4a37-a458-5900f1cdb71b')
;
-- Aug 9, 2015 11:42:50 PM WITA
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,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,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (1000001,0,'Load Page Num','When load data for info window, also load number of paging','Load number of paging maybe affect to performance when info window is join of many table',895,'isLoadPageNum','Y',1,'N','N','N','N','N',0,'N',20,0,0,'Y',TO_DATE('2015-08-09 23:42:50','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-08-09 23:42:50','YYYY-MM-DD HH24:MI:SS'),100,1000000,'Y','N','D','N','N','N','Y','fd37da5c-6442-425e-9217-fd186c67ff65','Y',0,'N','N')
;
-- Aug 9, 2015 11:42:55 PM WITA
ALTER TABLE AD_InfoWindow ADD isLoadPageNum CHAR(1) DEFAULT 'Y' CHECK (isLoadPageNum IN ('Y','N'))
;
-- Aug 9, 2015 11:43:33 PM WITA
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (1000001,'Load Page Num','When load data for info window, also load number of paging','Load number of paging maybe affect to performance when info window is join of many table',842,1000001,'Y',0,220,0,'N','N','N','N',0,0,'Y',TO_DATE('2015-08-09 23:43:33','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-08-09 23:43:33','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','6cc379fd-0f84-45d8-acf7-12f12ce4c753','Y',130,1,1,1,'N','N','N')
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=100,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13581
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=110,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201621
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=120,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201634
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=130,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13579
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=140,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13580
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201627
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201628
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=170, XPosition=5, ColumnSpan=2,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000001
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=190,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201639
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=200,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202198
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=210,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201807
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=220,Updated=TO_DATE('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202196
;
UPDATE AD_InfoWindow SET isLoadPageNum = 'Y'
;
SELECT register_migration_script('201509081982-IDEMPIERE-2470.sql') FROM dua l
;

View File

@ -0,0 +1,69 @@
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
-- Aug 9, 2015 11:42:05 PM WITA
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (1000000,0,0,'Y',TO_TIMESTAMP('2015-08-09 23:42:05','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-08-09 23:42:05','YYYY-MM-DD HH24:MI:SS'),100,'isLoadPageNum','Load Page Num','When load data for info window, also load number of paging','Load number of paging maybe affect to performance when info window is join of many table','Load Page Num','D','9ac2b88f-7ada-4a37-a458-5900f1cdb71b')
;
-- Aug 9, 2015 11:42:50 PM WITA
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,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,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure) VALUES (1000001,0,'Load Page Num','When load data for info window, also load number of paging','Load number of paging maybe affect to performance when info window is join of many table',895,'isLoadPageNum','Y',1,'N','N','N','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2015-08-09 23:42:50','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-08-09 23:42:50','YYYY-MM-DD HH24:MI:SS'),100,1000000,'Y','N','D','N','N','N','Y','fd37da5c-6442-425e-9217-fd186c67ff65','Y',0,'N','N')
;
-- Aug 9, 2015 11:42:55 PM WITA
ALTER TABLE AD_InfoWindow ADD COLUMN isLoadPageNum CHAR(1) DEFAULT 'Y' CHECK (isLoadPageNum IN ('Y','N'))
;
-- Aug 9, 2015 11:43:33 PM WITA
INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (1000001,'Load Page Num','When load data for info window, also load number of paging','Load number of paging maybe affect to performance when info window is join of many table',842,1000001,'Y',0,220,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2015-08-09 23:43:33','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-08-09 23:43:33','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','6cc379fd-0f84-45d8-acf7-12f12ce4c753','Y',130,1,1,1,'N','N','N')
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13581
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201621
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201634
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13579
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=13580
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201627
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201628
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=170, XPosition=5, ColumnSpan=2,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1000001
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201639
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202198
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201807
;
-- Aug 9, 2015 11:45:12 PM WITA
UPDATE AD_Field SET SeqNo=220,Updated=TO_TIMESTAMP('2015-08-09 23:45:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202196
;
UPDATE AD_InfoWindow SET isLoadPageNum = 'Y'
;
SELECT register_migration_script('201509081982-IDEMPIERE-2470.sql') FROM dua l
;

View File

@ -232,6 +232,19 @@ public interface I_AD_InfoWindow
*/
public boolean isDistinct();
/** Column name isLoadPageNum */
public static final String COLUMNNAME_isLoadPageNum = "isLoadPageNum";
/** Set Load Page Num.
* When load data for info window, also load number of paging
*/
public void setisLoadPageNum (boolean isLoadPageNum);
/** Get Load Page Num.
* When load data for info window, also load number of paging
*/
public boolean isLoadPageNum();
/** Column name IsShowInDashboard */
public static final String COLUMNNAME_IsShowInDashboard = "IsShowInDashboard";

View File

@ -30,7 +30,7 @@ public class X_AD_InfoWindow extends PO implements I_AD_InfoWindow, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20141030L;
private static final long serialVersionUID = 20150809L;
/** Standard Constructor */
public X_AD_InfoWindow (Properties ctx, int AD_InfoWindow_ID, String trxName)
@ -311,6 +311,30 @@ public class X_AD_InfoWindow extends PO implements I_AD_InfoWindow, I_Persistent
return false;
}
/** Set Load Page Num.
@param isLoadPageNum
When load data for info window, also load number of paging
*/
public void setisLoadPageNum (boolean isLoadPageNum)
{
set_Value (COLUMNNAME_isLoadPageNum, Boolean.valueOf(isLoadPageNum));
}
/** Get Load Page Num.
@return When load data for info window, also load number of paging
*/
public boolean isLoadPageNum ()
{
Object oo = get_Value(COLUMNNAME_isLoadPageNum);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Show in Dashboard.
@param IsShowInDashboard
Show the dashlet in the dashboard

View File

@ -496,8 +496,11 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
line = new ArrayList<Object>();
setCacheStart(-1);
cacheEnd = -1;
if (infoWindow == null || infoWindow.isLoadPageNum())
testCount();
else
m_count = Integer.MAX_VALUE;
if (m_count > 0)
{
m_useDatabasePaging = isIgnoreCacheAll || (m_count > 1000);
@ -872,7 +875,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
toIndex = line.size();
if (fromIndex >= line.size())
fromIndex = line.size() - 1;
fromIndex = line.size();
// case line.size = 0
if (fromIndex < 0)

View File

@ -39,6 +39,37 @@ Copyright (C) 2007 Ashley G Ramdass.
}
}
});
zk.afterLoad('zul.mesh', function () {
zk.override(zul.mesh.Paging.prototype, "bind_", function () {
this.$bind_.apply(this, arguments);
if (this._totalSize == 0x7fffffff){
jq(".z-paging-text", this).text("?");
}
});
zk.override(zul.mesh.Paging.prototype, "infoText_",
function () {
//this.$infoText_.apply(this, arguments);
var acp = this._activePage,
psz = this._pageSize,
tsz = this._totalSize,
lastItem = (acp + 1) * psz,
dash = '';
if ('os' != this.getMold())
dash = ' - ' + (lastItem > tsz ? tsz : lastItem);
if (this._totalSize == 0x7fffffff)
tsz = "?";
return '[ ' + (acp * psz + 1) + dash + ' / ' + tsz + ' ]';
});
});
]]>
</script>
<include src="${themePreference}"/>