-
Bug
-
Resolution: Fixed
-
Neutral
-
None
-
6.2.7
-
None
-
Ubuntu
Steps to reproduce
- Create a custom data source for the combobox options like so
@DatasourceType("anchorsDatasource") public class AnchorLinkSelectFieldSupport extends OptionSelectFieldSupport { private final LinkService linkService; @Inject public AnchorLinkSelectFieldSupport(final FieldDefinition fieldDefinition, final OptionListDefinition optionListDefinition, final LinkService linkService) { super(fieldDefinition, optionListDefinition); this.linkService = linkService; } @Override public DataProvider<Option, ?> getDataProvider() { final var noneOption = new Option(); noneOption.setValue(""); noneOption.setLabel("None"); // one may use a set of hard coded items to reproduce this issue final var options = Stream.concat( Stream.of(noneOption), linkService.getAnchorsDefinedInPage(null).stream() .map(anchor -> OptionUtil.of(anchor, anchor)) ); return DataProvider.fromStream(options); } }
- Register it:
<components> <id>datasource-anchors</id> <component> <type>info.magnolia.ui.field.SelectFieldSupport</type> <implementation>my.project.dialog.field.AnchorLinkSelectFieldSupport</implementation> </component> </components>
- Then use it in a dialog:
anchorTarget: label: fields.anchorTarget $type: comboBoxField datasource: name: anchors
Expected results
When creating a component which uses this field, the dialog should show the selected value.
Actual results
No value is shown even though it is correctly stored:
Acceptance criteria