COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: squish88 on 16 Jun 2011 04:07:19 PM

Title: Anal users and the prompt styles they want....
Post by: squish88 on 16 Jun 2011 04:07:19 PM
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!!
Title: Re: Anal users and the prompt styles they want....
Post by: squish88 on 21 Jul 2011 09:42:04 AM
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....  :-)

Title: Re: Anal users and the prompt styles they want....
Post by: Lisa Farrelly on 13 Sep 2011 06:04:45 AM
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
Title: Re: Anal users and the prompt styles they want....
Post by: squish88 on 13 Sep 2011 08:40:59 AM
Go to: Page Explorer --> Classes --> Prompt Control Hyperlink   and set the box type to none for that class.