I need help achieving the task described in the thread title. Let me provide some background:
I am developing a very large dashboard on spotfire that loads a lot of data for visualization. Some of those tables need to be loaded sequentially because of dependencies between them, but others can just be load simultaneously.
For the sequentially loaded tables, I use the following script:
import clr
from System.Collections.Generic import List, Dictionary
from Spotfire.Dxp.Data import DataTable
from Spotfire.Dxp.Framework.ApplicationModel import NotificationService
# Empty list to hold DataTables
Tbls = List[DataTable]()
Tbls.Add(dt1) #dt1 a DataTable string parameter
Tbls.Add(dt2) #dt2 a DataTable string parameter
# Notification service
notify = Application.GetService[NotificationService]();
# Execute something after tables are loaded
def afterLoad(exception, Document=Document, notify=notify):
if not exception:
Document.Properties["lastReload"]
print "OK"
else:
notify.AddErrorNotification("Error refreshing table(s)","Error details",str(exception))
# Refresh table(s)
Document.Data.Tables.RefreshAsync(Tbls, afterLoad)***
For tables with no dependancies, I used the following simple script:
from System.Collections.Generic import List, Dictionary
from Spotfire.Dxp.Data import DataTable
from System.Collections import ArrayList
dt3.Refresh()
dt4.Refresh()
dt5.Refresh()
I tried simply combining the scripts into a single one but the result was that all tables loaded sequentially.
With the naming used in these scripts, I would like the script to execute as follows:
- Load dt1
- Wait for dt1 to be fully loaded
- Load dt2
- Wait for dt2 to be fully loaded
- Load dt3, dt4 and dt5 all at the same time.
Best regards, and thanks in advance
MR