I have a script like below -
from Spotfire.Dxp.Application import Filters as filters
import Spotfire.Dxp.Application.Filters.ListBoxFilter
from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers
from Spotfire.Dxp.Data import *
from Spotfire.Dxp.Application.Filters import *
CurPanel = Document.ActivePageReference.FilterPanel
FilterA = CurPanel.TableGroups[1].GetFilter("column_name1")
CheckBoxesA = FilterA.FilterReference.As[filters.ListBoxFilter]()
FilterB = CurPanel.TableGroups[0].GetFilter("column_name2")
CheckBoxesB = FilterB.FilterReference.As[filters.CheckBoxFilter]()
print "success1"
for CheckBoxVal in CheckBoxesB.Values: CheckBoxesB.Uncheck(CheckBoxVal)
print "success2"
str = CheckBoxesA.ToString()
found, nodes = myTable.Columns ["column_name2"].Hierarchy.Levels.LeafLevel.TryGetNodes(int.MaxValue)
for node in nodes:
if str.Contains("All"): CheckBoxesB.check(node.Value.ValidValue)
if str.Contains(node.Value.ValidValue): CheckBoxesB.check(node.Value.ValidValue)
This works completely fine when I use CheckBoxFilter in line 10. But for the values more than 100, as spotfire automatically considers list box filter, I should modify the line 10 as below -
CheckBoxesB = FilterB.FilterReference.As[filters.ListBoxFilter]()
Then I get the following error message -
success1 Traceback (most recent call last): File "Spotfire.Dxp.Application.ScriptSupport", line unknown, in ExecuteForDebugging File "", line 16, in AttributeError: 'ListBoxFilter' object has no attribute 'Values'
System.MissingMemberException: 'ListBoxFilter' object has no attribute 'Values' at stub$619##619(Closure , CallSite , Object , CodeContext ) at Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func4 target, CallSite site, Object[] args) at Microsoft.Scripting.Actions.CallSite1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at $606##606(Closure , Scope , LanguageContext ) at Spotfire.Dxp.Application.ScriptSupport.IronPythonScriptEngine.ExecuteForDebugging(String scriptCode, Dictionary2 scope, Stream outputStream)
I understand issue with uncheck and check functions used in lines 12 and last two lines. Is there any equivalent function to be used for list box filter ?