How to default select all values in a Mutli select List Box Property

Hi,

I have created a multi select List box Document Property for a filter. User wants that all the values be selected by default or provide a way where in he can select all.

I was thinking that maybe I can script to select all the values to be selected on the click of a button. Can some one please tell me if this is possible and paste a sample code for the same. I am not much of a coder hence I want the sample code so that I can modify it according to my situation.

Regards,
Subro

2 Comments

IS there a wat that I can do same thing for ListBoxFitler?

Manideep - Jun 28, 2018 - 1:21pm

Hi frds,

This scripting works well for "Selece All " Option in check box filter.

Go to Text area --open Action Control--Script--new--(Paste below script and place your column name in the script at 5th line--give the name like Select All---click on ok.

 

To "Check All" or "Select All " in check box ( Uses Below Script)

 

import Spotfire.Dxp.Application.Filters as filters

import Spotfire.Dxp.Application.Filters.CheckBoxFilter

from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers

myPanel = Document.ActivePageReference.FilterPanel

myFilter= myPanel.TableGroups[0].GetFilter("Column Name")

myFilter.FilterReference.TypeId = FilterTypeIdentifiers.CheckBoxFilter

checkBoxFilter = myFilter.FilterReference.As[filters.CheckBoxFilter]()

checkBoxFilter.IncludeEmpty = False

for value in checkBoxFilter.Values:

  checkBoxFilter.Check(value)

 

 

to get  "Uncheck All" or  "Unselect All" (Uses Below Script)

 

 

 

import Spotfire.Dxp.Application.Filters as filters

import Spotfire.Dxp.Application.Filters.CheckBoxFilter

from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers

myPanel = Document.ActivePageReference.FilterPanel

myFilter= myPanel.TableGroups[0].GetFilter("Column Name")

myFilter.FilterReference.TypeId = FilterTypeIdentifiers.CheckBoxFilter

checkBoxFilter = myFilter.FilterReference.As[filters.CheckBoxFilter]()

checkBoxFilter.IncludeEmpty = False

for value in checkBoxFilter.Values:

  checkBoxFilter.Uncheck(value)

 

 

Thanks,

 Guru

gurusaisankar738 - Dec 06, 2016 - 11:56pm
+ Add a Comment

(1) Answer

Login