When a multifield type is defined in an asset editor, it will not save as a multi-value property if the author only provides a single value.
Based on this post, that may be expected behavior:
Re: String[] type for Multivalued Properties - AEM
However, if the author initially provides just one value, then adds a value later, it still does not convert to a multi-value property. This seems more like a bug than intended behavior.
I have tried implementing a fix as outlined in the above-mentioned post, but I have had no luck.
Here is an example of how I have tried to provide a type hint to always force it to be saved as a String array, in an asset editor definition. This doesn't work.
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Widget"
fieldLabel="Region"
name="./dc:region"
typeHint="String[]"
xtype="multifield">
<fieldConfig
jcr:primaryType="nt:unstructured"
options="/etc/acs-commons/lists/company/region/_jcr_content.list.json"
type="select"
xtype="selection"/>
</jcr:root>
Has anybody made this work?