Hi all,
-- on Cognos 11.1.5 --
We have a report using custom controls and where we are using some external resources in order to display the data in some nice graphical way (like 3d.js for example).
We are respecting the examples we found and we are building our JS files like:
define(['https://our_site/ibmcognos/samples/someFolder/someResource.js'], function() {
function myObject() { };
myObject.prototype.setData= function(oControlHost, oDataStore) {
};
myObject.prototype.draw= function(oControlHost, oDataStore) {
};
return myObject;
});
Problem: when the report is run for the first time on a computer, it appears that we get an error as if the code in the JS file was executed
before the resource "someResouce.js" (here, for the example only) was loaded.
Let's say we would load jQuery, then we would get an error message like: "$" doesn't exist ..etc.
Now, after refreshing the page or re-running the report. The problem is gone. Which means to me that the resource is somewhere in the cache.
Why do we have this and how to avoid this?
This is quite critical, to be honest ...
My understanding is that Cognos is using requireJS and the "define" function is part of that library. Is it correct?
In this case, while reading this "
The function will be called to define the module once all dependencies have loaded. " from here: http://requirejs.org/docs/api.html#define, I don't understand why we are facing this issue.
Any help / advice is welcome,
Thanks!------------------------------
Cosme POUSSET
------------------------------
#CognosAnalyticswithWatson