Set Checkbox/Switch status

Resolved

Hi ๐Ÿ™‚ We're trying to set the status of a Checkbox or Switch dynamically (e.g. using a component/app state variable or setting directly the new value). At the moment we can see only that there is, under the properties tab, the "Initial Value".

Is there any way to set, at the moment, to set the value of a Checkbox or Switch?

For example in our use case, we have a form that once submitted is reset, clearing all fields. In the above image we use a switch to indicate if it's about the "whole day" or a time range instead. By default the switch is "off" and the time pickers are hidden, but if the switch is turned "on" the time pickers are shown and can be indicated a time range. After the submission we have to reset the form, put the switch to "off" (to hide the time pickers).

Anyone has a different idea how to archive this eventually without setting the switch status?

Really many thanks!

8
17 replies