Hi,
With Isomorphic SmartClient 8 GA (JS), I use the following code:
When my JSON service returns no data, I get the following warning in the ISC console :
And my callback never gets executed.
I quickly looked at the DataSource code and found the following in the _handleJSONTextReply method:
Is there any way to have the callback executed with data == null as its parameter ?
Thanks again for the assistance,
With Isomorphic SmartClient 8 GA (JS), I use the following code:
Code:
var ds = DataSource.create ({ dataFormat : 'json', dataProtocol : 'postMessage', recordXPath : '/Allowance', dataURL : encodeURI(myURL), fields : [ { name : 'Buyer.Code', type : 'text' }, { name : 'Buyer.Name', type : 'text' } ] }); var requestProperties = { httpMethod : 'POST', contentType : 'application/json', httpHeaders : { 'Accept' : 'application/json' }, data : myJSONdata, useSimpleHttp : true, bypassCache : true, showPrompt : true }; ds.fetchData(null, function(dsResponse, data, dsRequest) { // I need this callback to get executed even when data == null }, requestProperties);
Code:
08:47:09.471:XRP8:WARN:DataSource:isc_DataSource_1:Evaluating JSON reply resulted in empty value. JSON text: "null"
I quickly looked at the DataSource code and found the following in the _handleJSONTextReply method:
Code:
// warn and bail if server response object evals to null. // This can happen if the response is "", or if it's something like "var foo = {};" // where the result of the eval is undef. // Avoids a JS error in handleJSONReply if (jsonObjects == null) { this.logWarn("Evaluating JSON reply resulted in empty value. JSON text:\r" + this.echo(jsonText)); return; }
Thanks again for the assistance,
Comment