COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: tibo on 17 Oct 2011 03:07:13 AM

Title: SOLVED: Retrieve search and select prompt
Post by: tibo on 17 Oct 2011 03:07:13 AM
Hello everyone,

I need a way to retrieve the values selected in a select and search prompt. I already read some documentation about it. You can't use the _oLstChoices-method with the search and select prompt, but you have to use the getElementsByTagname or the getElementsById functions. I tried that (after I put the spantag with the id around the prompt), but it's not working for me..

Anyone has any idea how to use these functions?

thx a lot in advance,
best regards
tibo
Title: Re: Retrieve search and select prompt
Post by: tibo on 17 Oct 2011 09:33:12 AM
solved for single-select search and select prompt:

put html div tags around the prompt, like:
<div id = "Prompt_id">s&sprompt</div>

Then use a script to retrieve it:
<script>
function retrievePrompt()
{
var selection = document.getElementById('Prompt_id').getElementsByTagname('select');
alert(selection[0].options.value); //to check if it worked
}
</script>

Then create a custom button to launch te function:
<input type = "button" value =  "finish" onClick="retrievePrompt()">

cya laterz