Tibco SPOTFIRE 7.5 how execute a custom script on load of analisys

2.1k views Asked by At

I have to execute a script on load of an Spotfire analisys. I used this method:

JScript:

$(function () {
 function executeScript() {
 $('#hiddenBtn input').click();
 }
$(document).ready(function(){executeScript()});
});

HTML:

<Span style="display:none" id="hiddenBtn">
<SpotfireControl id="f8322a6109af43fb935ad6e7bcb1f1fc" /></span>
IronPython script on HiddenButton:

if Document.Properties["OpenedYet"] == False:
Document.Properties["OpenedYet"] = True
## Script you are trying to run on open here

BUT

the event $(document).ready() FIRE continuously and script was executed continuously. I tried with $(document).load() or $(window).load() but the event was never fired. There is a way to execute a script ONCE on load?

1

There are 1 answers

0
CVNicolescu On

Actually it might be better to use a hidden input field in order to change the document property and thus to trigger the python script.

Have a look here...

and also here