Products | Versions |
---|---|
Spotfire Web Player | All Versions |
In general, IronPython scripts cannot be set to automatically execute when a report is opened, but instead must be manually triggered with an action control button/link or on a property change. One method to trigger the script to execute automatically is to use a data function, which executes when the analysis is opened to update a document property configured to execute the IronPython script on a property change. Another method is through the use of Javascript and HTML script. When an IronPython script is set to be executed on loading of an analysis using data functions, the same will be executed when the analysis is cached by the scheduled updates as well. However the IronPython script may not be executed when this cached analysis is loaded because Data function is set to trigger only if its input parameters change.
input output <- Sys.time()Input Parameter:
<Span style="display:initial" id="myBtn"> <P><SpotfireControl id="0bd86d67c6414b15a9cb54aa3d7dff62" /></P> </span>The id here will correspond to the Button Action control
$(document).ready(function() { if(!document.readyFlag) { $("#myBtn .sf-element ").trigger("click"); document.readyFlag=true; } })Here readyFlag is a runtime flag used to click the button.Once the button is clicked the readyFlag is set to true, so the java script would not be re-executed.