Option to make parameter not editable/read-only

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.

Hi Vincent,

Thanks for your suggestion.
We have an outstanding issue for this limitation. It is currently not planned in yet. I noticed you have not mentioned the ‘OutputField’ in your post. I think it might meet some of your needs. Check out the OutputField documentation for more info. Hope that helps!

Thanks for the reply. Good that Viktor atleast has an issue for this. Hopefully it gets implemented soon.

Thanks for the suggestion on OutputField, I will look into it.

1 Like