Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SelectItem with optionDataSource but without mapping

    Hi,

    I have SelectItem with optionDataSource to supply option list. This item is simple text and there is no mapping between real value and display value. If I use static value map I can supply array of text options and it works without any mapping. But if I want to use optionDataSource I have to use mapping and set valueField = displayField which creates internal map with all keys values. I think it's a bit odd behavior and it would be better to use array in this case.
    But my problem is that SelectItem with optionDataSource never displays missing values without datasource fetch. When this field is initially populated it triggers datasource fetch to obtain displayValue. But I don't want any fetches until user wants to edit this field and opens picklist.
    I found that SelectItem has overridden _setElementValue "to prevent the element from displaying unavailable values". One of the possible solutions is to create ValueMap with single element for each SelectItem/ComboBox on DynamicForm for each setValue call. But I think it's unconvinient and redundant. Any other way how to force SelectItem with optionDataSource to display value without any fetches?
Working...
X