Hello!
I am using UI Designer to create a form with an enumeration field, that is displayed in a compact layout. One of the options of the resulting select has to be made readonly (being displayed as disabled in the html). I have attempted to implement it using dependent enumerations, but it does not fit my use case since the options are deleted from the list in that case. Is there any way to make only one of the enumeration options readonly(disabled)?
Did you try Dependent Field?
Dependent field allows me to make the whole field readonly, but this is not intended here. Only one of the options has to be readonly
Would it not be easier to show just a select without it? Because Why display if the user cannot select it.
Alternative if only know the programmatical way:
Creating a Custom DefaultInputWidgetFactory and DefaultReactWidgetFactory.
Override createSelectInput:
createSelectInput(
{ items, ...props }: SelectProps & { items: SelectItemProps[]; },
hint?: string,
key?: React.Key
): React.ReactElement<{}> {
return React.createElement(
Select,
{
...props,
tooltips: this.createTooltips(hint, undefined, props.disabled),
key: key
},
...items.map((itemProps, index) => React.createElement(
Select.Item,
{
...itemProps,
key: index
}
))
);
}
The information you can give when it is readonly via label or annotation.
This option is still valid and can be assigned from a different input source. The user should be able to see it selected in such a case and be able to change it to a different one. But if a different option is selected user should be prohibited from changing to this one
In the meantime I have created an A12 ticket <INTERNAL_LINK>