【发布时间】:2018-04-24 09:14:09
【问题描述】:
如何添加按钮以及每当用户单击按钮时数据都会重新加载。
用户还应该知道数据何时刷新。
【问题讨论】:
-
您是否按照此链接中的步骤操作? community.tibco.com/wiki/…
-
@MarkP。我会把它作为答案发布,因为它是一个完美的解决方案
标签: refresh reload spotfire tibco
如何添加按钮以及每当用户单击按钮时数据都会重新加载。
用户还应该知道数据何时刷新。
【问题讨论】:
标签: refresh reload spotfire tibco
您可以使用这个 python 脚本,如 here 所示。
from System.Collections.Generic import List, Dictionary
from Spotfire.Dxp.Data import DataTable
from System.Collections import ArrayList
#Refreshing a single Data table:
dataTable.Refresh() // where dataTable is a script parameter of type DataTable
#Refreshing multiple tables:
#Note that more than one table can be added to the List object.
tables = ArrayList()
tables.Add(Document.Data.Tables["DataTable1"])
tables.Add(Document.Data.Tables["DataTable2"])
Document.Data.Tables.Refresh(tables)
#As such DataTableCollection.Refresh Method refreshes the given tables in dependency order.
#OR
Document.Data.Tables.RefreshAsync(tables)
#And DataTableCollection.RefreshAsync Method (IEnumerable< DataTable> ) refreshes the given tables in dependency order.
#Tables that have asynchronous refresh (i.e. Data On Demand and Data Functions) and tables that depend on them will be refreshed
#in later transactions.
# Another possible option:
Tbls = List[DataTable]()
Tbls.Add(Document.Data.Tables["DataTable1"])
Tbls.Add(Document.Data.Tables["DataTable2"])
for i in Tbls:
Document.Data.Tables.Refresh([i])
为了让用户知道数据何时刷新,只需使用当前日期/时间设置一个文档属性,并在文本区域中显示该文档属性。当上面的脚本运行时,日期/时间将会更新。
另外,请查看位于here 的 Python API 页面(适用于 7.6,但也可以找到更新的 7.12 API)。虽然它的组织方式有点令人沮丧,但您可以了解可以在脚本中调用的方法和类,以编程方式执行各种操作。
【讨论】: