Does anyone know how to create an indication of a table refreshing?
For example: I have a button Action Control Item in a Text Area that refreshes a data table. This table is connected to a database, so sometimes the refresh takes <1s, sometimes it can take much longer (>15s). Either of these scenarios could confuse users. So, I would like to have an indicator (like a Dynamic item) that says the data table has been refreshed or not, or maybe the last time the table has been successfully been refreshed. Is this possible??
Thanks to Vineet's comment I accomplished what I wanted to do. It's not exactly what I had in mind, but I wasn't considering the DateTimeNow() function and that works. Here's what it looks like now for anyone that searches for this in the future. By the way - the new Spotfire 7 color theme feature is ballin'.
Direwolf (can I call you Ghost?) -
Here's what I did, you can modify as needed.
In a Text Area, Insert an Action Control. I made mine a button with text "Get Data."
Select "Script" to the left of the window, select New... give it a name (Refresh data table x) and in the script area...
# some comments like author, date, whatever...
# Import needed namespaces
from Spotfire.Dxp.Data import *
from Spotfire.Dxp.Data.Import import *
# Create Data Manager object
dataManager = Document.Data
# Point to the and refresh it
dataTableName = dataManager.Tables["YourDataTableNameYouWantToRefreshGoesHere"]
# no longer part of script...
This will create a clickable button in a text area that a user can click and it will refresh the data table. For example, the reason I do this is my data table is hooked up to a database. The user makes some selections in my file, I tie those to document properties, and use those values in a SQL query on the database. So the user can refresh the data table and the new data will be specific to what they have chosen in the file.
Can you provide the Iron Python script that you used to refresh the data since i am looking for the same. It would be helpful if you give it with steps.
There is a way - I've written up a guide on our wiki:
I couldnt get this to work in V7.6 client, but adding "vis=vis" in the call to the second script, and "from Spotfire.Dxp.Application.Visuals import HtmlTextArea" at the start of the second script seemed to do the trick.
I have implemented same, the progress bar is working on professional client but not working in web player. what could be the reason, no error at all on web player.
Have you thought about putting a calculated value in a text area, which can read a timestamp column from underlying database which will store last refresh datetime or you can use datetimenow function in Spotfire as calculated value(if the refresh of data is real- time).
If you want to take the script approach with button that's fine, but if looking for a simpler solution since you don't have a DB column, I'd recommend using a calulated field with DateTimeNow and display it in text area.
The approach I'm recommeding will make sense if you're using In Database instead of In memory.
Hey Vineet -
Thanks to your comment I accomplished what I wanted to do. It's not exactly what I had in mind, but I wasn't considering the DateTimeNow() function and that works. Here's what it looks like now for anyone that searches for this in the future. By the way - the new Spotfire 7 color theme feature is ballin'.
in case that image ^ doesn't work...
<img src='http://s31.postimg.org/3oc8g6tmz/Capture.jpg' />
Thanks for your response Vineet.
You mean pull in an extra column from the database that contains the date? I don't think the database I'm pulling from has that.
I may edit my script so that when the table is refreshing, the cursor changes to an hourglass/loading icon. Then, when the refresh is done it will change back to a regulor cursor. This way, there is some feedback during/after the refresh.