I have a use case where i need to render data table(set to on-demand) in text area using python scripting in Spotfire.
The problem at hand is data table is loaded Asynchronously and python script is executed and html turns out to be empty as it takes some 5 sec to load data, i tried using sleep function of 5 secs but that is not appropriate as PROD data load time will vary.
I need to execute the python script in the below manner:
-------Script--------
if table.IsRefreshable and table.NeedsRefresh: table.Refresh()
//#Execute next steps when data is loaded //#Render data table to dynamic html to be displayed in text area
If you are lucky enough to have Spotfire 7.5, they've added a method:
DataTableCollection.RefreshAsync Method (IEnumerable< DataTable> , Action< Exception> )
in which you can write a callback function to execute after the table(s) finish loading. I've never used it because I only have 6.5 and also need some way to do this (and haven't found one)
https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/tib_sfire-analyst_api/?topic=html/Overload_Spotfire_Dxp_Data_DataTableCollection_RefreshAsync.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With