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

SELECT & SEARCH Prompt / customizable?

Started by DTV12345, 11 Dec 2007 06:41:58 PM

Previous topic - Next topic

DTV12345

Greetings!

I have a report with a SELECT & SEARCH Prompt. My boss requires that our users (senior executives) do not have to click 'OPTIONS' and enable the 'Contains all of these keywords' sub-option. My boss told me this 'sub-option' should be enabled at runtime.

I am thinking of using Javascript. I found this script that I tweaked so it `walks` my prompt page and displays its element names one by one.

Quote<script type="text/javascript">
function getInfo() {
for(var i = 0; i < document.forms["formWarpRequest"].elements.length; i++)
{  alert("element type = " + document.forms["formWarpRequest"].elements.type + "\nelement name = "
+ document.forms["formWarpRequest"].elements.name)}}
</script><input type="button" name="RptWalk" onclick="getInfo()" >
Walk!

This is how I found the name of the `Contains all of these keywords` property I want to use _sws_TITLESEARCHLIST_matchAll.

Problem is that I am unsure how to code the script I have to add on my prompt page. Since TITLESEARCHLIST is the element name for my SELECT & SEARCH Prompt, I assume I would have to call the `Contains all of these keywords` property, right? I have tried using

document.forms["formWarpRequest"].elements["_sws_TITLE_selectChoicestitleSearch"].property[0]=false
and
document.forms["formWarpRequest"].elements["_sws_TITLE_selectChoicestitleSearch"].option[0]=false


...and I get the "...Is Null Or Not An Object" error message. Can someone please provide a few suggestions or pointers?

Thanks in advance,

Al.

PS: Can this be done without using Javascript?

COGNOiSe administrator

No, it cannot be done without JavaScript. I've thought I've seen it doen on this forum before ...


zaith

#3
first sorry bad english.

I guess only javascript can do that.

Try this for one search in prompt page:
assign a ID for "Select & Search Prompt", SSP for example.
Insert HTML Item at end of page with this code:
Quote
<script language="javascript">
document.all.swsMatchAll.checked="true";
searchSSP.setOptions('on', 'on');
</script>

if you have more than one "Select & Search Prompt" use this:
Quote
<script language="javascript">
var e=document.getElementsByName("swsOptionSSP");
for(var i=0;i<e.length;i++){
if (e.id == 'swsMatchAll') {
   e.checked="true";
}
}
searchSSP.setOptions('on', 'on');
</script>

Repeat this for anothers "Select & Search Prompt" changing only SSP for your ID.

I tested here and works fine.

DTV12345

Guys,

Per Zaith's suggestion, I tried

Quote<script language="javascript">
document.all.swsMatchAll.checked="true";
searchSSP.setOptions('on', 'on');
</script>

...and it worked!! One question about "setOptions" ... is it a Javascript function or simply a Cognos function?


zaith

is a Cognos function for class search in javascript.

change title of topic and include [Solved]  ;D

benjaaz

If MatchAll is for "Contains all of these keywords"  what are the values for the other three options?  I need to do this with the third one.