Hello,
We want to be able to override prompt and timeout settings for specific datasources. Here is the code we've been using to do this. This code works and overrides fetchData and removeData no problem. But, it is not overriding addData or updateData. Can you show me what is wrong with it and why it successfully overrides fetchData and removeData but not the other 2?
We want to be able to override prompt and timeout settings for specific datasources. Here is the code we've been using to do this. This code works and overrides fetchData and removeData no problem. But, it is not overriding addData or updateData. Can you show me what is wrong with it and why it successfully overrides fetchData and removeData but not the other 2?
Code:
var anDS = isc.DataSource.getDataSource("AssetNotes"); anDS.addMethods({ fetchData : function (record, callback, requestProperties) { if (requestProperties == null) requestProperties = {}; if (requestProperties.timeout == null) requestProperties.timeout = TIMEOUT_LENGTH_SMARTCLIENT_FETCH_SHORT; if (requestProperties.prompt == null) requestProperties.prompt = "<spring:message code="prompt.fetch"/>"; return this.Super("fetchData", [record, callback, requestProperties]); }, updateData : function (record, callback, requestProperties) { if (requestProperties == null) requestProperties = {}; if (requestProperties.prompt == null) requestProperties.prompt = "<spring:message code="prompt.saving"/>"; if (requestProperties.timeout == null) requestProperties.timeout = TIMEOUT_LENGTH_SMARTCLIENT_UPDATE_SUPER_LONG; return this.Super("updateData", [record, callback, requestProperties]); }, removeData : function (data, callback, requestProperties) { if (requestProperties == null) requestProperties = {}; if (requestProperties.prompt == null) requestProperties.prompt = "<spring:message code="prompt.remove"/>"; if (requestProperties.timeout == null) requestProperties.timeout = TIMEOUT_LENGTH_SMARTCLIENT_REMOVE; return this.Super("removeData", [data, callback, requestProperties]); }, addData : function (record, callback, requestProperties) { if (requestProperties == null) requestProperties = {}; if (requestProperties.prompt == null) requestProperties.prompt = "<spring:message code="prompt.saving"/>"; if (requestProperties.timeout == null) requestProperties.timeout = TIMEOUT_LENGTH_SMARTCLIENT_ADD_SUPER_LONG; return this.Super("addData", [record, callback, requestProperties]); } })
Comment