Morning Everyone,
I've been working on this issue for a couple of days and I can't figure out a fix. I've researched and googled to no avail. Any help/insight would be greatly appreciated. I am trying to create a button that when clicked will automatically go through a Date filter (starting on 1/1/15 say) and go through 1/2 -1/5 updating a map with the newly filtered marker layer as it steps through the function. I have gotten the filter to step through 1/1-1/5; however, it doesn't update the map visualization as it progresses so all the user sees is a jump from 1/1 to 1/5 with a pause in between (I have a sleep timer in for each step). I've included the code below, I'm just learning IronPython and I'm not sure what I need to call to refresh a visualization. Visualization.Refresh() does not work. Thanks so much!
import Spotfire.Dxp.Application.Filters as filters
import Spotfire.Dxp.Application.Filters.ItemFilter
import time
from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers
from Spotfire.Dxp.Data import DataProperty, DataType, DataPropertyAttributes, DataPropertyClass
from Spotfire.Dxp.Application.Visuals import MarkerLayer
myPanel = Document.ActivePageReference.FilterPanel
myFilter= myPanel.TableGroups[2].GetFilter("Date (Daily)")
myFilter.FilterReference.TypeId = FilterTypeIdentifiers.ItemFilter
itemFilter = myFilter.FilterReference.As[filters.ItemFilter]()
whichCol = itemFilter.DataColumnReference
count = 0
while count < 5:
count = count +1
if (whichCol.Properties.PropertyExists("CurrentStep") == False):
myProp = DataProperty.CreateCustomPrototype("CurrentStep",0,DataType.Integer,DataPropertyAttributes.IsVisible|DataPropertyAttributes.IsEditable)
Document.Data.Properties.AddProperty(DataPropertyClass.Column, myProp)
whichCol.Properties.SetProperty("CurrentStep",0)
Document.Properties["DateTest"] = "1/1/15"
time.sleep(1)
else:
time.sleep(1)
whichVal = whichCol.Properties.GetProperty("CurrentStep")
#print whichVal
#print itemFilter.Values.Count
if (whichVal == itemFilter.Values.Count):
whichCol.Properties.SetProperty("CurrentStep",0)
Document.Properties["DateTest"] = "1/1/15"
else:
itemFilter.Value = itemFilter.Values.Item[whichVal]
whichCol.Properties.SetProperty("CurrentStep",whichVal+1)
Document.Properties["DateTest"] = itemFilter.Value
