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

Anal users and the prompt styles they want....

Started by squish88, 16 Jun 2011 04:07:19 PM

Previous topic - Next topic

squish88

Hi all,
  So, my obnoxious users have decided that the default "Select All"/"DeSelect All" hyperlinks under a multiselect value prompt are "too ugly" and would like them converted to checkboxes that do the same thing.  I was able to hide them using the built in functionality, but have so far been unable to google any examples of others doing the checkbox part.  IBM's response was that it wasn't possible w/out javascript.  I looked online but not being a javascript programmer, I wasn't sure what would/wouldn't work with the new 8.4+ (we're on 10.1) versions of report studio.  It looks like it's changed from what worked in 8.1, but I'll be honest, I don't fully comprehend the differences.   So, I guess I have 2 questions...  1)  Has anyone implemented anything like this before, and if so how... and 2) Does anyone have or know of a list that has the cognos specific properties and/or methods that can be called when referencing the prompt controls in javascript?
   Thanks in advance guys!!

squish88

Should anyone else need to do this silliness, here's what I ended up doing:

I went to: Page Explorer --> Classes --> Prompt Control Hyperlink
and set the box type to none for that class.

I then added an HTML item (text source) that contained this Java Script at the top of the prompt page:


<script language="javascript">
  //<! [CDATA[

       function Select_All()
       {
    var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
   if ( !fW || fW == undefined) { fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );}
   var list = fW._oLstChoicesBob;
   
   for( i =0; i < list.options.length; i++){
      list.options.selected = true;
   }

   document.getElementById("ChkNone").checked = false;
       }

      function DeSelect_All()
       {
    var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
   if ( !fW || fW == undefined) { fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );}
   var list = fW._oLstChoicesBob;
   
   for( i =0; i < list.options.length; i++){
      list.options.selected = false;
   }
   document.getElementById("ChkAll").checked = false;
       }


   //]]>
</script>



From there I used 2 other HTML (text source type) items to create a span.  One in front of the prompt, and one after.  In the one after, I added the code to create the buttons that call the java functions:

        <div ALIGN=RIGHT>
          <input  type = "checkbox"
                       id = "chkAll"
                       value = "all" 
                       onClick="Select_All()"/> <font face="arial" color="333333">Select All</font>
          <input  type = "checkbox"
                        id = "chkNone"
                       value = "none" 
                       onClick="DeSelect_All()"/>  <font face="arial" color="333333">UnSelect All</font>
       </div>
</div>


Hope that saves some time for anyone that has users as annoying as mine....  :-)


Lisa Farrelly

Hi You mentioned hiding the "Select All"/"DeSelect All"  using in built functionality - where would I do this - my user does't want this brilliant idea available!
Regards

squish88

Go to: Page Explorer --> Classes --> Prompt Control Hyperlink   and set the box type to none for that class.