Min Su Sun Posted May 22, 2023 Share Posted May 22, 2023 After creating an initial button in the textarea, how to set the default value for the first item in the radio button (when there is no All option)I made an initial button and a radio button (if there is no All option) in the textarea.I want to create a function that initializes all filters when the initail button is clicked and defaults the first item to the radio button without the All option. I would appreciate it if you could let me know if there is a way to satisfy all of the features below.When clicking the initial button1. Reset all filters2. Set the first item of the radio button without All to be automatically selected3. Set the message not to appear only in the case Link to comment Share on other sites More sharing options...
Gaia Paolini Posted May 22, 2023 Share Posted May 22, 2023 This script does the reset first, then removes the All option and sets the filter to its first value. However, if you were to reset the filters from the Filter Panel, you would get the warning.You can still show the All option and set the filter to the first value, it will select the individual value and not the All option.from Spotfire.Dxp.Application.Filters import RadioButtonFilter table = Document.Data.Tables['your table name']filtering_scheme = Document.FilteringSchemes[0] #first scheme availablecolumn_name = 'your column name'myfilter=filtering_scheme.Item[table].Item[table.Columns.Item[column_name]].As[RadioButtonFilter]() myfilter.Reset()myfilter.ShowNone=Falsemyfilter.AllowAll=False values= myfilter.Valuesfirst_value = min(values)myfilter.Value=first_value Link to comment Share on other sites More sharing options...
Min Su Sun Posted May 22, 2023 Author Share Posted May 22, 2023 The following error message occurs.How should I fix it? Link to comment Share on other sites More sharing options...
Gaia Paolini Posted May 22, 2023 Share Posted May 22, 2023 it is telling you that filter does not exist. I guess you specified the data table or the column or the filter type incorrectly. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now