COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Universe09 on 01 Jul 2009 09:25:20 PM

Title: how to attach a onclick javascript to ptomptbutton?
Post by: Universe09 on 01 Jul 2009 09:25:20 PM
Hi,

Can anyone please help me how to attach a onlick function to a promptbutton finish? because I want to reset all the listbox to its default selection once the finish promptbutton was click.

your replies will be much appreciated!

Thanks!
Reggie
Title: Re: how to attach a onclick javascript to ptomptbutton?
Post by: Gopinath on 02 Jul 2009 02:39:06 AM
You can't do this with Cognos Finish Button. Instead create a custom Finish button using HTML. Delete the default Finish button and place a HTML item and copy/paste the following code into it.

//HTML code for Finish button
<input type="BUTTON" class="clsPromptButton" onClick="resetvalue()" value="Finish"/>


Place another HTML item and copy/paste the following code.
<script>
function resetvalue()
{

if (canSubmitPrompt())
       promptButtonFinish();

code to reset all the listbox to its default selection

}
</script>

hope this helps
Title: Re: how to attach a onclick javascript to ptomptbutton?
Post by: Universe09 on 02 Jul 2009 04:45:49 AM
Hi,

I have tried the code and it works, but I have another related question to ask. is it possible that I add a function on the onlick event where after it refresh the page another table will show in the report.?

is there a possible javascript to handle this problem?

again your replies is much appreciated!

Thanks!
Title: Re: how to attach a onclick javascript to ptomptbutton?
Post by: GowthamSen on 24 Apr 2013 02:46:27 PM
Hi,

I am looking for some thing like this.

I have a button. But I dont want users to "click" on the button. As and when the last prompt is filled, it should automatically click on button using java script.

Please help.

Thanks!
Title: Re: how to attach a onclick javascript to ptomptbutton?
Post by: yossiea on 24 Apr 2013 03:56:38 PM
If you mean that you want the report to run without having to press finish, then just change the prompts to "autosubmit"