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 and search propmt api

Started by yoniw, 21 May 2014 10:13:21 AM

Previous topic - Next topic

yoniw

Hey all,
I use Cognos 10.2.1 fp1...

We are using a prompt page with a button (javascript) that when you click on it, a block with "advanced filters" is been shown.
one of the prompts is select and search prompt.
Select and search prompt regenerates the page - > and the default of the block is display:none.
Is there a way to indicate that the user used a select and search prompt and will the block will be opened automatically?

I tried to use the prompt api to see if there is something written inside the "textbox" of the select and search but no luck... only reached to the selected values... maybe if i had a way to indicate that something is written in the text box it will trigger an event that will open the advanced filter block.

If you have other ideas... please share (the whole problem relates to the reload of the page)

I hope i was clear :)
Regards,
Yoni

navissar

Hi Yoni,
Let's start with your solution. Unfortunately, prompt API won't help you there - we'll need to do things the old fashioned way.
So, put one HTML Item to the left of your SnS prompt, and another to the right of it.
In the one to the left put in:
<span id="shekerkolshehu">
The second one should have the following code:
</span>
<script>
var theSpan=document.getElementById("shekerkolshehu");
var theInputBoxes=theSpan.getElementsByTagName("input");
var theBox;
for (var i=0;i<theInputBoxes.length;i++){
if(theInputBoxes[i].name&&theInputBoxes[i].name=='_searchValue'){theBox=theInputBoxes[i];}
}
if(theBox.value.length>0){
alert("yesh sham mashehu");
}
</script>

This bit will loop through all input boxes in the span until it finds one named "_searchValue" which is what Cognos calls the search box, and looks to see if there's something there. In the If statement that follows, simply change the alert that reads "yesh sham mashehu" (To our non Hebrew speaking friends, that's "There's something there") to the bit of code you need to show the prompts.

Having said that, SnS prompts are dreadful and I try to work around them whenever I can.

yoniw

Hey Nimrod - Thanks it works!!
I just changed the alert from alerting to open the block of the advanced filters of course.

Brilliant:)
Thank you very much ahi!
(BTW,You have dash From Michael (B))
Yoni