Multifield issues with msm-lockable | Community
Skip to main content
Level 9
December 15, 2022
Question

Multifield issues with msm-lockable

  • December 15, 2022
  • 1 reply
  • 1089 views

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>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Shashi_Mulugu
Community Advisor
Community Advisor
December 16, 2022

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/wcm/components/accordion/v1/accordion/_cq_dialog/.content.xml

 

 

 

Except typehint option, never faced any issues with multifield, usually add button also should be hidden/readonly in livecopy unless inheritance is broken.

 

 

 

 

 

 

 

Level 9
December 16, 2022

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.