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>
Views
Replies
Total Likes
Hi @NitroHazeDev did you had a chance to check how AEM core components work? https://github.com/adobe/aem-core-wcm-components/blob/main/content/src/content/jcr_root/apps/core/wc...
Except typehint option, never faced any issues with multifield, usually add button also should be hidden/readonly in livecopy unless inheritance is broken.
Thank you for the response, usually it should yes, but it is not. The resource type for the multifield is provided above. Will check core components, but did you have a chance to check the multifield with data provided above?
This is incorporated on page properties dialog and we are on AEM 6.5.12.
So, accordion would not work .. i missed providing details , apologies- thought it would be obvious with the xml which is not easy to read through. So i have this nested structure where i want to have a dropdown , and restrict it to just one field(multifield with one field only) and based on the dropdown a new field shows up .
acs-commons-nested="JSON_STORE" is used. Btw, i moved the lockable one level higher and added a container and it worked. Will post the script in a few but the issue that remains, which IMO is minor but itches is
break inheritance, delete the field, you should see add field now. The link icon is missing .. unless you click add field again, and if you do so, the link icon appears but to the bottom of the last field in the dialog, that it is related to the issue here
https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1271
wonder if it is all acs related.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies