Hi,
We are having a multifield with a dropdown selection(AssetType) having 3 values(Image,DAM Video,Youtube video) inside the multifield.
When we select the image in the drop down, image related multifield container fields will get displayed and two containers(DAM Video and Youtube Video) will be hidden. Now we will author the image related fields.
Next we will be adding one more multifield item by selecting the drop down as "youtube" now youtube related multifield container fields will get displayed and two containers(DAM Video and Image) will be hidden. Now we will author the Youtube video related fields.
Dialog properties are getting stored on the page as below.
{"assetType":"image","imagePath":"/content/dam/images/IMG-NeilHausmann-Profile-0.97_1-2018-13.jpg","altText":"Neil Hausman Headshot","imageTitle":"Test","imageCaption":"Test","imagecopyright":"Test","videoPath":"","videoTitleS7":"","videoDescriptionS7":"","videoThumbnailS7":"","videoId":"","videoTitle":"","videoDescription":"","videoThumbnail":""}
{"assetType":"youtube","imagePath":"","altText":"","imageTitle":"","imageCaption":"","imagecopyright":"","videoPath":"","videoTitleS7":"","videoDescriptionS7":"","videoThumbnailS7":"","videoId":"test","videoTitle":"Test ","videoDescription":"Test","videoThumbnail":""}
Now when we open the authored dialog on the page values are not displaying the authored values.
PFB dialog
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" 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="nt:unstructured"
jcr:title="Gallery Image"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/tabs"
type="nav"/>
<items jcr:primaryType="nt:unstructured">
<tab1
jcr:primaryType="nt:unstructured"
jcr:title="Gallery Image Details"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>
<items jcr:primaryType="nt:unstructured">
<columns
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<title
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldDescription="Component Title"
fieldLabel="Component Title"
maxlength="{Long}100"
name="./title"/>
<introtext
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textarea"
fieldDescription="Component Intro Text"
fieldLabel="Component Intro Text"
maxlength="{Long}400"
name="./introText"
required="{Boolean}true"/>
<gallery
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/multifield"
fieldLabel="Asset List"
minItems="1">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fieldset"
acs-commons-nested=""
name="./gallery">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
method="absolute"/>
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container"
assetfieldstobepopulated="\{"imageAltText":"./altText"}"
class="assetMetadataClass">
<items jcr:primaryType="nt:unstructured">
<assetType
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
class="cq-dialog-dropdown-showhide-multi assetType"
cq-dialog-dropdown-showhide-target=".assetType-option-listtype-showhide-target"
fieldDescription="Select the Asset Type."
fieldLabel="Asset Type"
name="./assetType"
required="{Boolean}true"
value="">
<items jcr:primaryType="nt:unstructured">
<image
jcr:primaryType="nt:unstructured"
text="Image"
value="image"/>
<scene7
jcr:primaryType="nt:unstructured"
text="Scene7"
value="scene7"/>
<youtube
jcr:primaryType="nt:unstructured"
text="YouTube"
value="youtube"/>
</items>
</assetType>
<imageUrl
jcr:primaryType="nt:unstructured"
sling:resourceType="corteva/components/content/contextualpathbrowser"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin"
contentRootPath="/content/dam/dpagco"
fieldLabel="Select Image Path"
name="./imagePath"
required="{Boolean}false"
showhidecustomtargetvalue="image"/>
<imageAltText
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Image Alt Text"
fieldLabel="Image Alt Text"
name="./altText"
required="{Boolean}false"
showhidecustomtargetvalue="image"/>
<imageTitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldLabel="Image Caption Title"
maxlength="{Long}87"
name="./imageTitle"
required="{Boolean}false"
showhidecustomtargetvalue="image"/>
<imagecaption
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textarea"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Image Caption Description"
fieldLabel="Image Caption Description"
maxlength="{Long}55"
name="./imageCaption"
required="{Boolean}false"
showhidecustomtargetvalue="image"/>
<imagecaptioncopyright
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textarea"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Image Caption Copyright"
fieldLabel="Image Caption Copyright"
maxlength="{Long}250"
name="./imagecopyright"
required="{Boolean}false"
showhidecustomtargetvalue="image"/>
<videoPath
jcr:primaryType="nt:unstructured"
sling:resourceType="corteva/components/content/contextualpathbrowser"
assetfieldstobepopulated="\{"videoTitle":"./videoTitleS7", "videoDescription":"./videoDescriptionS7", "videoAltText":"./videoAltTextS7", "videoImage":"./videoThumbnailS7"}"
class="isMandatory assetMetadataClass assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
contentRootPath="/content/dam/dpagco"
fieldDescription="Select the Scene7 Video path."
fieldLabel="Video Path"
fieldstobepopulated="\{"jcr:title":"./title"}"
name="./videoPath"
required="{Boolean}false"
showhidecustomtargetvalue="scene7"/>
<videoTitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Provide video title."
fieldLabel="Video Title"
maxlength="{Long}50"
name="./videoTitleS7"
showhidecustomtargetvalue="scene7"/>
<videoDescription
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textarea"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Provide video description."
fieldLabel="Video Description"
name="./videoDescriptionS7"
showhidecustomtargetvalue="scene7"/>
<videoThumbnail
jcr:primaryType="nt:unstructured"
sling:resourceType="corteva/components/content/contextualpathbrowser"
class="isMandatory assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
contentRootPath="/content/dam/dpagco"
fieldDescription="Provide video thumbnail image URL. "
fieldLabel="Video Thumbnail Image"
name="./videoThumbnailS7"
required="{Boolean}false"
showhidecustomtargetvalue="scene7"/>
<videoId
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
class="js-focus-out isMandatory assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Enter Video Id."
fieldLabel="Video Id"
name="./videoId"
required="{Boolean}false"
showhidecustomtargetvalue="youtube"/>
<Youtube_x0020_videoTitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Provide video title."
fieldLabel="Video Title"
maxlength="{Long}50"
name="./videoTitle"
showhidecustomtargetvalue="youtube"/>
<Youtube_x0020_videoDescription
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textarea"
class="assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
fieldDescription="Provide video description."
fieldLabel="Video Description"
name="./videoDescription"
showhidecustomtargetvalue="youtube"/>
<Youtube_x0020_videoThumbnail
jcr:primaryType="nt:unstructured"
sling:resourceType="corteva/components/content/contextualpathbrowser"
class="isMandatory assetType-option-listtype-showhide-target foundation-layout-util-vmargin hide"
contentRootPath="/content/dam/dpagco"
fieldDescription="Provide video thumbnail image URL. "
fieldLabel="Video Thumbnail Image"
name="./videoThumbnail"
required="{Boolean}false"
showhidecustomtargetvalue="youtube"/>
</items>
</column>
</items>
</field>
</gallery>
</items>
</columns>
</items>
</tab1>
</items>
</content>
</jcr:root>
Thanks & Regards,
Kalyan
Views
Replies
Total Likes
Need more details on the setup. Can you log a daycare ticket with reproducible steps and share the component package?
That should be the quickest way to resolve this issue.
Views
Replies
Total Likes
Try to test on the latest SP/CFP level of whatever AEM version you are using since there were few known issues with multifield.
Views
Replies
Total Likes
Alternatively you can see the following article where it uses Coral multi-field components for similar purpose:
Creating a Granite/Coral 6.3 Multifield HTL component for Adobe Experience Manager
Views
Replies
Total Likes