In the example in the docs: https://smartclient.com/smartclient-...ansformRequest
... shows this:
This used to work in older versions, now it does not.
Because dsRequest.data is getting set to null, where it used to enter this function as an empty (but existing) object.
The workaround for now is to do something like this:
I compared old code to new, stepped through it, and found where it's different:
Old, in ISC_DataBinding.js (line 56611-ish in debug version of js file):
New, in ISC_DataBinding.js (line 57819-ish in debug version of js file):
This happens down in ISC_DataBinding.js (line 38025-ish in debug version of js file):
Cheers!
ECDragon
... shows this:
Code:
transformRequest : function (dsRequest) { // modify dsRequest.data here, for example, add fixed criteria dsRequest.data.userId = myApplication.getCurrentUserId(); return this.Super("transformRequest", arguments); }
Because dsRequest.data is getting set to null, where it used to enter this function as an empty (but existing) object.
The workaround for now is to do something like this:
Code:
transformRequest : function (dsRequest) { // modify dsRequest.data here, for example, add fixed criteria if (!dsRequest.data) { dsRequest.data = {}; } dsRequest.data.userId = myApplication.getCurrentUserId(); return this.Super("transformRequest", arguments); }
Old, in ISC_DataBinding.js (line 56611-ish in debug version of js file):
Code:
getServerFilter : function () { .... return isc.shallowClone(this.criteria); // This just returns an empty object (if this.criteria is an empty object) },
Code:
getServerFilter : function () { .... return this.getCombinedCriteria(); // This returns null if this.criteria is an empty object },
Code:
compressNestedCriteria : function (criteria, outerOp, isSubCrit) { // this method will take a nested criteria object and reduce it (like flattenCriteria(), // but its not all or nothing) to its simplest format (like simplifyAdvancedCriteria(), // but without installing extra outer adv-crit or flagging single criterions as advanced) if (!criteria || isc.isAn.emptyObject(criteria)) return null; // This is where it happens! If criteria is empty, it returns null!!! ....
ECDragon
Comment