Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Trigger script when clicking on a tab

1. Page is opened
2. Text Area renders and executes Javascript
3. Javascript finds hidden action control link and clicks it

html
<div id='hiddenActionControl' style='display:none'>
<SpotfireControl id="link4ct10nc0n7r01" />
</div>

js
//executes every time the text area renders
$('#hiddenActionControl a').click()

script
#this script is triggered by the javascript associated in the text area through a hidden action control link.
Document.Properties["tabCount"] = Document.Properties["tabCount"] + 1

4 comments:

alirulzz@gmail.com said...

where does the following go:

script
#this script is triggered by the javascript associated in the text area through a hidden action control link.
Document.Properties["tabCount"] = Document.Properties["tabCount"] + 1

Thank you.

Jose Leviaguirre said...

@alirulzz, That is an iron python script that is triggered when the tab is clicked. So, every time the tab is clicked, or I should say, switched from a different tab, the page will render a text area causing the javaScript to run. JavaScript will then trigger the Spotfire script. In this example, it increments a document property.

Anivar Melaya said...

Unfortunately, this is no longer feasible in Spotfire version 10.3
You could switch action control from link to button for it to work a bit, but since the recent update, even use of action control button doesn't deliver trigger.

Jolene said...

The above comment is not true. Switch your control from a link to a button, and use $('#hiddenActionControl input').click();

This has been tested in 10.3.3.


html


*format your DateTime document property to display ms

js
//executes every time the text area renders
$('#hiddenActionControl input').click()

script
#this script is triggered by the javascript associated in the text area through a hidden action control button.

from System import DateTime
#Retrieve the current datetime
Document.Properties["docPropLabel"] = DateTime.Now