Hi,
I am currently using Cognos 8 to develop reports. Cognos 8 renders reports as a web page by mixing up a report template and source data. To achieve a lot of advanced functionality in Cognos 8 its necessary to embed HTML tags in the report template. These tags contain javascript. For example embedding DIV tags around a combo box control, then assigning some javascript to the object identified by the DIV tags.
So basically I am bound by what I can achieve by embedding these tags DIV.
What I want to do is conditionally override a couple of HREF links in my report, based on a label at the top of the report. When this Label is 'N' I want to override some HREF links with a popup box that says 'you can't do that'. When the Label is 'Y' I want the links to do what they are hard coded to do.
Another complication is that the individual HREF links are not in the template so I can't apply javascript to them individually before hand. I need to apply the javascript override to a whole group of links. Again the whole group can be surrounded by DIV (I think), and they all do the same thing.... eiher show a pop up box or perform their original intention (go to a link)
So:
1. Is it possibly to write javascript which overrides a hard coded HTML link?
2. Is it possible to conditionally enable/disable this override based of a bit of text earlier in the page (which would concievably have DIV tags around it)
3. Is it possible to do this for a whole group of HREF links in a generic fashion - either override them all or not.
4. Can you help me with the code for this, including DIV (as we cannot refer to objects by name we need to surround them by DIV's)
I realise this is a hefty question. Any assistance is appreciated, even if you can't answer it all.
Start Free Trial