G'day Y'all
I'm working with CA11.0.4 in Reports (Report Studio - you can change the hair colour, and add lipstick but it's still RS!). Putting JavaScript in HTML items is not supported in Full Interactive Mode (which we all want of course). Instead all JS is now put in external files and matched up with CSS and JSON scripts. The JS file is referenced by a new Toolbox item call a "Custom Control". This is a good idea and supposedly does away with the upgrade hassles with embedded JS.
BUT, now this moves drag and drop developers like me back screaming into the 3GL/5GL coding world. Instead of a snippet you could beg, borrow, or steal from others, we now have to actually know how to code in JS using the extended API. And learn JSON scripting.
There are some examples in the samples but I have not had much luck installing and running the CA11.0.4 samples yet.
What are your thoughts?
Hi!
You can still steal your snippets - in fact the stealing is more simple because you only would have to copy a javascript file and link to it in your report. You can find a few examples here: https://cognos11.wordpress.com/2016/10/27/javascript-hello-world/ (https://cognos11.wordpress.com/2016/10/27/javascript-hello-world/).
Not sure where you would need JSON though? Despite the fact that you can't use most of the old samples I think it's a good move, especially because you are not interfering with any internal Javascript code and it's compatible to new versions.
Chris
Quote from: Blue on 30 Oct 2016 10:19:15 PM
There are some examples in the samples but I have not had much luck installing and running the CA11.0.4 samples yet.
Hi Blue!
What was your problem to run the samples?! After I've copied the samples into the web server directory I also had to change them in the report samples.
Yours Gernot
G'day Gernot
I installed the samples from the CA11.0.4 download and it seemed all was fine. But I do not see any samples in the Content folders.
There is a sample1 and sample2 in the ../bi/samples folders on the server but those folders have no JS examples.
This is a concurrent install with CBI10.2.2. I see a new samples folder under ../IBM/cognos/ but the samples there are for CBI10.2.2 only.
Cheers,
Blue
Quote from: Blue on 31 Oct 2016 04:57:53 PM
G'day Gernot
I installed the samples from the CA11.0.4 download and it seemed all was fine. But I do not see any samples in the Content folders.
There is a sample1 and sample2 in the ../bi/samples folders on the server but those folders have no JS examples.
This is a concurrent install with CBI10.2.2. I see a new samples folder under ../IBM/cognos/ but the samples there are for CBI10.2.2 only.
Cheers,
Blue
G'day Blue (how I've loved being able to type that as a greeting over the years! :) )
After you installed the 11.0.4 samples, did you pick up the samples deployment archive and restore the content from it? Were there any errors during the restore?
Cheers!
MF.
Yep. See attached. No errors.
CM-REQ-2300 Import is complete. 96 object(s) were imported. 0 object(s) failed.
Blue
Quote from: Blue on 01 Nov 2016 04:33:06 PM
Yep. See attached. No errors.
CM-REQ-2300 Import is complete. 96 object(s) were imported. 0 object(s) failed.
Blue
Ok. Quick sanity check. Was the CBI 1022 Backup deployment a backup of the entire 10.2.2 content store? If so, was it imported before or after the Samples_for_install deployment?
MF.
Quote from: Blue on 31 Oct 2016 04:57:53 PM
G'day Gernot
I installed the samples from the CA11.0.4 download and it seemed all was fine. But I do not see any samples in the Content folders.
There is a sample1 and sample2 in the ../bi/samples folders on the server but those folders have no JS examples.
This is a concurrent install with CBI10.2.2. I see a new samples folder under ../IBM/cognos/ but the samples there are for CBI10.2.2 only.
Cheers,
Blue
the js samples are here
https://www.ibm.com/communities/analytics/cognos-analytics-blog/javascript-support-in-interactive-viewer/
(at the end of the article)
MF. The CBI10.2.2 backup was only dashboards, reports, and folders, not the entire content store.
Cheers Gernot.
This info helps, somewhat. I still need someone beside to translate JavaScript speak (luckily I do have someone :) )
So now I have something weird going on.
Four item menu defined in JSON as part of a CC. Each card name matches the name of a block (set as none-block).
When user clicks menu item that particular block should display.
Get a JS error on
for (var i = 0; i < this.m_sCardNames.length; i++) //
{
this.m_nlButtonDivs.item(i).classList[(i == iCardIndex) ? "add":"remove"]("selected"); //
if (this.m_sCardNames) //
{
oPage.getControlByName(this.m_sCardNames).setDisplay(i == iCardIndex); //
}
}
when the loop reaches the forth card/block name. Trippple checked and card name matches block name exactly, as the other cards do for their respective blocks.
Blue