Author Topic: Checkbox Prompt not displaying Tick Mark  (Read 2809 times)

Offline paddhu

  • Senior Member
  • ****
  • Join Date: Jan 2010
  • Posts: 66
  • Forum Citizenship: +4/-0
Checkbox Prompt not displaying Tick Mark
« 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
« Last Edit: 05 Jul 2012 04:37:20 pm by paddhu »

Offline paddhu

  • Senior Member
  • ****
  • Join Date: Jan 2010
  • Posts: 66
  • Forum Citizenship: +4/-0
Re: Checkbox Prompt not displaying Tick Mark
« Reply #1 on: 09 Jul 2012 07:05:18 am »
Any inputs on this ?? Guess it seems to be some herculean issue..

Offline bpothier

  • Community Leader
  • *****
  • Join Date: May 2012
  • Posts: 87
  • Forum Citizenship: +0/-0
Re: Checkbox Prompt not displaying Tick Mark
« Reply #2 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.

Offline paddhu

  • Senior Member
  • ****
  • Join Date: Jan 2010
  • Posts: 66
  • Forum Citizenship: +4/-0
Re: Checkbox Prompt not displaying Tick Mark
« Reply #3 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...

Offline Rahul Ganguli

  • Community Leader
  • *****
  • Join Date: Jul 2012
  • Posts: 195
  • Forum Citizenship: +5/-0
Re: Checkbox Prompt not displaying Tick Mark
« Reply #4 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

Offline paddhu

  • Senior Member
  • ****
  • Join Date: Jan 2010
  • Posts: 66
  • Forum Citizenship: +4/-0
Re: Checkbox Prompt not displaying Tick Mark
« Reply #5 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.

Offline Nupur89

  • Full Member
  • ***
  • Join Date: May 2015
  • Posts: 6
  • Forum Citizenship: +0/-0
Re: Checkbox Prompt not displaying Tick Mark
« Reply #6 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.

Offline Arumugam

  • Senior Member
  • ****
  • Join Date: Jul 2016
  • Posts: 56
  • Forum Citizenship: +0/-0
Re: Checkbox Prompt not displaying Tick Mark
« Reply #7 on: 12 Dec 2017 08:59:37 am »
I am facing same issue..Anyone have solution for this

 


       
Twittear