Thanks for the use case. I've tried to use this dialog:
form:
implementationClass: info.magnolia.ui.field.AddPageLinksMultiFormView
properties:
pages:
$type: jcrMultiField
itemProvider:
$type: jcrChildNodeProvider
nodeName: links
orderHandler:
class: info.magnolia.ui.editor.MultiFormDefinition$OrderHandlerDefinition$Noop
field:
$type: compositeField
properties:
pages:
$type: pageLinkField
with this form implementation:
public class PagesMultiFormView extends MultiFormView<Node> {
@Inject
public PagesMultiFormView(MultiFormDefinition<Node> formDefinition, LocaleContext localeContext, Datasource<Node> datasource) {
super(formDefinition, localeContext, datasource);
}
@SneakyThrows
@Override
public void write(Node node) {
for (Node page : valueContext.get().collect(Collectors.toSet())) {
final Iterator<Node> nodeIterator = QueryUtil.search("website",
"select * from [mgnl:component] where"
+ " [mgnl:template] = 'mtk2:components/textImage'"
+ " AND ISDESCENDANTNODE('" + page.getPath() + "')"
);
nodeIterator.forEachRemaining(super::write);
}
}
}
which is then stored like
'0':
'mgnl:template': 'mtk2:components/textImage'
'links':
'pages0':
'jcr:uuid': '87d2027c-a5fd-44c5-93d8-505f8da658ed'
'pages': 'b06b82a2-74b0-4994-8015-028c4fd60716'
...