Multifield issues with msm-lockable
Created a multifield widget with res type - granite/ui/components/foundation/form/multifield
I have a typehint property set to store as string[] if i have just one multifield entry used https://www.flexibledesigns.rs/string-array-type-for-multivalued-properties/
I also had to ensure i added to the end of the list of fields to keep the link icon stable and not attached to the last valid field , which it does .. so setting it to a dummy field and bug -
https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1271
<space
jcr:primaryType="nt:unstructured"
sling:resourceType="/libs/granite/ui/components/foundation/form/textfield"
class="hidden"/>
issue i see is :
If i have a livecopy of a site, and it has no entries but "Add Field" displayed, clicking "Add field" and saving it, will store as String and not String[]. This is not the case with the blueprint site.
Does anyone know how this can be resolved?
Attaching content.xml for that multifield here.
<testurl
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/multifield"
class="full-width test-links-multifield"
fieldDescription="test URLs"
fieldLabel="test URL"
typeHint="testlist@String[]">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fieldset"
acs-commons-nested="JSON_STORE"
cq-msm-lockable="./testlist"
name="./testlist">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<linkType
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
class="test-links-dropdown"
fieldDescription="Select Link type"
fieldLabel="Link Type"
name="./linkType">
<items jcr:primaryType="nt:unstructured">
<none
jcr:primaryType="nt:unstructured"
text="Select Link Type"
value="none"/>
<external
jcr:primaryType="nt:unstructured"
text="External Link"
value="canext"/>
</items>
</linkType>
<externalLink
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
class="canext"
fieldLabel="External Link"
name="./canextLink"/>
<space
jcr:primaryType="nt:unstructured"
sling:resourceType="/libs/granite/ui/components/foundation/form/textfield"
class="hidden"/>
</items>
</column>
</items>
</field>
</testurl>
