COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: paddhu on 05 Jul 2012 04:31:25 PM

Title: Checkbox Prompt not displaying Tick Mark
Post by: paddhu on 05 Jul 2012 04:31:25 PM
Hi,
We have a JavaScript to select a defaultValue in a check box prompt in prompt page.
The weird thing is, the value is selected. However the check box doesn't display the tick mark.
If I click on Finish button, the report page shows that the value is selected indeed.

Here is the JS I used for selecting the first prompt value by default.

<script>
var theSpan = document.getElementById("myCheckBox");
var myInput = theSpan.getElementsByTagName("input");
myInput[0].checked="1";
myInput[0].ariaChecked=true;
myInput[0].parentNode.className = "dijitInline dijitCheckBox";
</script>

I'm going crazy trying all ways to select the value; everything turns success to select the value, but doesn't show the tick mark though... Any solutions?

PS: The code works like a gem in Cognos 8.4; it fails to show the tick mark only in Cognos 10.1.1
Title: Re: Checkbox Prompt not displaying Tick Mark
Post by: paddhu on 09 Jul 2012 07:05:18 AM
Any inputs on this ?? Guess it seems to be some herculean issue..
Title: Re: Checkbox Prompt not displaying Tick Mark
Post by: bpothier on 09 Jul 2012 01:56:41 PM
we did not use java but this is how we set up our checkboxes

1.   Open report in Report Studio then unlock report.
2.   Drag 2 images into the field where you want to place the checkboxes.
3.   Open up your variables and create a new Variable as a string.
4.   Add 2 new Values, one a Y and the other a N.
5.   Rename the Variable to something meaningful.
6.   Go back to the report page and highlight the first image in your field.
7.   In the properties go to the Render Variable hit the elipses and find the Variable, uncheck the N box.
8.   Add ..\pat\hal\images\lv_checkbox_checked.gif to the URL under URL Source.
9.   Go back to the report page and highlight the second image in your field.
10.   In the properties go to the Render Variable hit the elipses and find the Variable, uncheck the Y box.
11.   Add ..\pat\hal\images\lv_checkbox.gif to the URL under URL Source.
12.   Highlight the field name, make it invisible and center the boxes.
Title: Re: Checkbox Prompt not displaying Tick Mark
Post by: paddhu on 10 Jul 2012 02:40:45 PM
Thanks for the reply. However, I should confess that in my case the number of items in the check box prompt is dynamic, and the value that needs to be selected by default may not always be the first item. In this case showing/hiding images of tick mark may not work out...
Title: Re: Checkbox Prompt not displaying Tick Mark
Post by: Rahul Ganguli on 12 Jul 2012 06:54:23 AM
Hi Paddhu,

Use the following script.

<script>
var theSpan = document.getElementById("myCheckBox");
var myInput = theSpan.getElementsByTagName("input");
myInput[1].checked="1";
myInput[0].ariaChecked=true;
myInput[0].parentNode.className = "dijitInline dijitCheckBox";
</script>

I have change the index to 1. Since the first checkbox is hidden and not shown to users.

Regards,
Rahul
Title: Re: Checkbox Prompt not displaying Tick Mark
Post by: paddhu on 23 Jul 2012 01:43:13 PM
Doesn't seem to work either.. For now we have coded with a workaround Default Selection in the prompt using some calculated data items, but it doesn't give the full functionality expected. Would still like to know any inputs on this.
Title: Re: Checkbox Prompt not displaying Tick Mark
Post by: Nupur89 on 08 Jun 2015 09:50:52 AM
Hi can you please provide me solution that you have done I am also facing the same problem.
Title: Re: Checkbox Prompt not displaying Tick Mark
Post by: Arumugam on 12 Dec 2017 08:59:37 AM
I am facing same issue..Anyone have solution for this