Hi all, i have a MultiSelectField and i want to change its values acording to a ToggleButton. The problem is when i use to togle button to change the list values of the multifield, if previously there are values selected, those same values still will appear after the list change, and viktor will tell me that there is an error with the multifield
THis is the multifield
tab_r.section_3.input_3 = MultiSelectField("Basic", options=basic_report_options)
This is the function that fills the options in the multifield
def basic_report_options(params, **kwargs):
# This is the toggle button
es_calculo_cimentacion_profunda = params.tab_p.section_1.cimentacion_profunda
if es_calculo_cimentacion_profunda:
return ["Test1", "Test2", "Test3"]
else:
return ["Joint", "Deep (m)","B_BC (m)","B_EQ (m)","B_Sett (m)","B_Ex (m)","L_Ex (m)","Total_Sett (m)"]
For example, if the switch is off this are the options available, and i select two
If now i press the switch to on, the new list appear but the previously selected items are still visible and viktor says thare there is an error with the input
How can i clean the selection of the list before changing its values?