If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Javascript issues in Upgrading 8.2 to 8.3

Started by kamatamdeva, 09 Jul 2008 09:50:10 AM

Previous topic - Next topic

kamatamdeva

Hello,
    We are migrating 8.2 to 8.3 and have some javascript issues. your help is appreciated.

Here is the issue that we have.

We used the following Cognos Supportlink article in all of our reports to remove the default 2 options from cognos value prompt

(http://support.cognos.com/supported/supportlink/15n4/techreview02.xml) . I am attaching the article as an image here



Here is the image of default cognos value prompt with Parameter name and “--------------“

We are removing the line and also replacing the text Parameter1 with more meaningful information like

“Please select Week” etc.

We are getting the name Week in above line from the properties of the prompt







We found that article in cognos support site and it is useful to remove those 2 lines for all the prompts with one script like below.



<script language="javascript">

var x = document.getElementsByTagName('select');

var RN_SelectName = "_oLstChoices";
var RN_SelectClass = "clsSelectControl";

var is_Required;

for (var i=0;i<x.length;i++)
{
if (x.className != RN_SelectClass) continue;

eval('is_Required =
listBox'.concat(x.name.substr(
RN_SelectName.length,x.name.length).concat
('.isRequired();')));

for (var j=0;j<x.length;j++)
{
if (x.options(j).value == "") {
x.remove(j);
}
}

if (is_Required) {
//remove the "-------------" option
x.remove(0);
eval('listBox'.concat(x.name.substr(
RN_SelectName.length,x.name.length).concat('.checkData
()')));
}
else {
//make "-------------" option blank
x.options(0).text = '';
x.options(0).value = '';
}
}

</script>







Now I Found the below article in cognos website but seems to be difficult to get the prompt name from properties with the below script

      For IBM Cognos 8.1 and 8.2 use this code fragment :

             <script>
                     document.formWarpRequest._oLstChoicesPromptName[0].text = 'My Own Text';
            </script>



    For IBM Cognos 8.3 use this code fragment :

              <script language="JavaScript">

                  function setDefaultValue()
                  {
                       var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);

                       if (fW)

                       {

                            fW._oLstChoicesPromptName.options[0].text = 'My Own Text';
                            fW._oLstChoicesPromptName.focus();
                            fW._oLstChoicesPromptName.blur();
                        }
                  }

                  setTimeout("setDefaultValue()", 10);
            </script>




Thanks
Deva Kamatham


masilabalu

Hi,

I am using 2 Radio Button, in that button we used 2 prompt...here i want to pass radio button value into Query Data Item...

the JavaScript code is given below....

<script language="JavaScript">
function callFunction()
{
   var node_list = document.getElementsByTagName('input');
for (var i = 0; i < node_list.length; i++)
{
   var node = node_list;
   if(node.getAttribute('type')=='radio')
   {
      if(node.checked)
      {
         document.getElementById('divAbsDate').style.display="";  // In this <div> one value prompt is there
         document.getElementById('divDateRange').style.display="none"; // In this <div> another value prompt

         if(node.value=='Yes')
         {

            document.getElementById('divAbsDate').style.display="";
            document.getElementById('divDateRange').style.display="none";
      
         }
         else
         {
            
            document.getElementById('divAbsDate').style.display="none";
            document.getElementById('divDateRange').style.display="";

         }
      }
      
   }
}
}
</script>

and Radio button code is.....

<div align="center">
&nbsp;&nbsp;
<input type="radio" name="group1" value="Yes" onClick='callFunction()'> Absolute Date

<input type="radio" name="group1" value="No" onClick='callFunction()'> Date Range

</div>


pls help me for this....

Thanks
Balu.