Description of the limitation and why it is relevant to address
We would really like the option for parameters to lock editing to make a (preselected) value not editable.
I think this is relevant for the VIKTOR platform because it allows for more flexibility in the parameters without adding multiple parameters that are controlled via visible as workaround.
I noticed this shortcoming because we want to limit the options depending on a selected calculation type. For one calculation, there is only one valid answers so we want to select that one as default in the OptionField
and then make the optionfield uneditable. For another calculation type, this OptionField might be editable because there are more valid options.
Submitter proposed design (optional)
For all parametrization fields like OptionField, NumberField (so basically the field class), add a parameter like locked=True|False
or editable=True|False
with the default ofcourse beeing editable.
The parameter needs to support functions/ boolean operators to make the lock dynamic.
Current workarounds
A somewhat workaround would be to have both an input field and a text field. Using visiblity, show the text field with the predifined, uneditable answer as feedback to the user.