<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Nested Multifield in Content Fragment - AEM 6.5 ? in Adobe Experience Manager Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/456421#M131371</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="13026194"&gt;&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you found any solution for the scenario you mentioned above, if so kindly share the solution so that we can try from our side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 15 Jun 2022 13:00:25 GMT</pubDate>
    <dc:creator>akcena_07</dc:creator>
    <dc:date>2022-06-15T13:00:25Z</dc:date>
    <item>
      <title>Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421857#M120123</link>
      <description>&lt;P&gt;I have implemented&amp;nbsp; multi-field&amp;nbsp; in content fragment and it working and there is no any issue.&lt;/P&gt;&lt;P&gt;Also, Implementing&lt;STRONG&gt; nested multi-field&lt;/STRONG&gt; but somehow it is working but &lt;STRONG&gt;not working fully&lt;/STRONG&gt;. Values are &lt;STRONG&gt;getting save at backend&lt;/STRONG&gt; but when i open the content fragment there are no auto value rendering in CF.&lt;/P&gt;&lt;P&gt;Has &lt;STRONG&gt;anyone implemented it&lt;/STRONG&gt; or&lt;STRONG&gt; written JS code&lt;/STRONG&gt; for the same . Please let me know. Thank You..!!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 05:04:08 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421857#M120123</guid>
      <dc:creator>kchaurasiya</dc:creator>
      <dc:date>2021-09-07T05:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421861#M120125</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="13026194"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a good article for Content Fragment with Multifield:&lt;/P&gt;&lt;P&gt;&lt;A href="https://jimfrenette.com/aem/content-fragments/composite-multifield/" target="_blank"&gt;https://jimfrenette.com/aem/content-fragments/composite-multifield/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 05:21:30 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421861#M120125</guid>
      <dc:creator>Asutosh_Jena_</dc:creator>
      <dc:date>2021-09-07T05:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421871#M120126</link>
      <description>&lt;P&gt;Please refer this&amp;nbsp;&lt;A href="https://allaembykiran.wordpress.com/2021/01/13/nested-multi-field/" target="_blank"&gt;https://allaembykiran.wordpress.com/2021/01/13/nested-multi-field/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 06:07:28 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421871#M120126</guid>
      <dc:creator>Kishore_Kumar_</dc:creator>
      <dc:date>2021-09-07T06:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421893#M120131</link>
      <description>&lt;P&gt;This is what you can try:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a content reference multifield in the first content fragment model.&lt;/LI&gt;&lt;LI&gt;Create a 2nd content fragment model and again add a multifield of required type there.&lt;/LI&gt;&lt;LI&gt;Reference the content fragments of second type from the first type&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I think this would be the simpliest way to achieve this. May me you can try customizing as given in the links shared here in previous comments depending on your requirement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:28:36 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421893#M120131</guid>
      <dc:creator>ibishika</dc:creator>
      <dc:date>2021-09-07T08:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421895#M120132</link>
      <description>&lt;P&gt;&lt;LI-USER uid="7532759"&gt;&lt;/LI-USER&gt;&amp;nbsp;Thanks Ashutosh for reply. Multifield i have already implemented in CF. I am looking for nested multifield in content fragment that is somehow working but not fully. For that we need to write the custom js code, I need that. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:40:41 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421895#M120132</guid>
      <dc:creator>kchaurasiya</dc:creator>
      <dc:date>2021-09-07T08:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421897#M120133</link>
      <description>&lt;P&gt;&lt;LI-USER uid="11336974"&gt;&lt;/LI-USER&gt;&amp;nbsp;Thanks Kishor. I have already implemented multifield in component but&amp;nbsp; I need to implement in Content Fragment not in component. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:43:48 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421897#M120133</guid>
      <dc:creator>kchaurasiya</dc:creator>
      <dc:date>2021-09-07T08:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421899#M120135</link>
      <description>&lt;P&gt;&lt;LI-USER uid="14296237"&gt;&lt;/LI-USER&gt;&amp;nbsp;I have already implemented nested multi field in Content fragment but it is not working fully. Have u implemented it ??&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:45:17 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421899#M120135</guid>
      <dc:creator>kchaurasiya</dc:creator>
      <dc:date>2021-09-07T08:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421906#M120137</link>
      <description>&lt;P&gt;Oh ok my bad sorry. I haven't tried customizing CF for nested multifield capability in 6.5. But if you can share us some sample code what you have achieved so far, me/someone may help to fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 09:10:09 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/421906#M120137</guid>
      <dc:creator>Kishore_Kumar_</dc:creator>
      <dc:date>2021-09-07T09:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/422001#M120162</link>
      <description>&lt;P&gt;I have tried this once and had to do a lot of customization to get it working.&lt;/P&gt;&lt;P&gt;In your content fragment model, you need to make the change similar to this: ( i am just showing a part of CFM which I had made composite multifield.&lt;/P&gt;&lt;PRE&gt;&amp;lt;multifieldtest
	jcr:primaryType="nt:unstructured"
	sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
	composite="{Boolean}true"
	fieldLabel="Test Service"
	listOrder="1"
	maxlength="255"
	metaType="text-single"
	name="testSection"
	renderReadOnly="false"
	showEmptyInReadOnly="true"
	valueType="string[]"&amp;gt;
	&amp;lt;field
		jcr:primaryType="nt:unstructured"
		sling:resourceType="granite/ui/components/coral/foundation/container"
		name="./testSection"&amp;gt;
		&amp;lt;items jcr:primaryType="nt:unstructured"&amp;gt;
			&amp;lt;column
				jcr:primaryType="nt:unstructured"
				sling:resourceType="granite/ui/components/coral/foundation/container"&amp;gt;
				&amp;lt;items jcr:primaryType="nt:unstructured"&amp;gt;
					&amp;lt;!-- your fields go heare --&amp;gt;
				&amp;lt;/items&amp;gt;
			&amp;lt;/column&amp;gt;
		&amp;lt;/items&amp;gt;
	&amp;lt;/field&amp;gt;
&amp;lt;/multifieldtest&amp;gt;&lt;/PRE&gt;&lt;P&gt;After that, used the following code to populate the data into the fields:&lt;/P&gt;&lt;PRE&gt;(function ($) {
    var CFM = window.Dam.CFM,
        MASTER = "master",
        CFM_EDITOR_SEL = ".content-fragment-editor",
        CORAL_MF_ITEM = "coral-multifield-item",
        EAEM_COMPOSITE_ITEM_VALUE = "data-eaem-composite-item-value",
        MF_NAME_ATTR = "data-granite-coral-multifield-name",
        COMPOSITE_MF_SEL = "[data-granite-coral-multifield-composite]";

    CFM.Core.registerReadyHandler(getMultifieldsContent);

    extendRequestSave();

    function getMultifieldsContent(){
        if(!compositeMutifieldsExist()){
            return;
        }

        var url = CFM.EditSession.fragment.urlBase + "/jcr:content/data.2.json";

        $.ajax(url).done(loadContentIntoMultiFields);
    }

    function loadContentIntoMultiFields(data){
        var $composites = $(COMPOSITE_MF_SEL), mfValArr, mfAddEle,
            vData = data[getVariation()], $lastItem;

        if(_.isEmpty(vData)){
            return;
        }

        _.each($composites, function(mField){
            mfValArr = vData[getNameDotSlashRemoved(($(mField)).attr(MF_NAME_ATTR))];

            if(_.isEmpty(mfValArr)){
                return;
            }

            mfAddEle = mField.querySelector("[coral-multifield-add]");

            _.each(mfValArr, function(mfMap){
                mfAddEle.click();

                $lastItem = $(mField).find(CORAL_MF_ITEM).last();
                $lastItem.attr(EAEM_COMPOSITE_ITEM_VALUE, mfMap);
                Coral.commons.ready($lastItem[0], function (lastItem) {
                    fillMultifieldItems(lastItem);
                });

            });
        });
    }

    function fillMultifieldItems(mfItem){
        if(mfItem == null){
            return;
        }

        var mfMap = mfItem.getAttribute(EAEM_COMPOSITE_ITEM_VALUE);

        if(_.isEmpty(mfMap)){
            return;
        }

        mfMap = JSON.parse(mfMap);

        _.each(mfMap, function(fValue, fKey){
            const field = mfItem.querySelector("[name$='" + fKey + "']");

            if(field == null){
                return;
            }

            setFieldValue(field, fValue);
        });
    }

    function setFieldValue(field, value){
        if( field.tagName == "CORAL-CHECKBOX"){
            field.checked = (field.getAttribute("value") == value);
        }else{
            field.value = value;
        }
    }

    function getVariation(){
        var variation = $(CFM_EDITOR_SEL).data('variation');

        variation = variation || "master";

        return variation;
    }

    function compositeMutifieldsExist(){
        return !_.isEmpty($(COMPOSITE_MF_SEL));
    }

    function extendRequestSave(){
        var orignFn = CFM.editor.Page.requestSave;

        CFM.editor.Page.requestSave = requestSave;

        function requestSave(callback, options) {
            orignFn.call(this, callback, options);

            if(!compositeMutifieldsExist()){
                return;
            }

            var mfsData = getMultifieldData();

            if(_.isEmpty(mfsData)){
                return;
            }

            var url = CFM.EditSession.fragment.urlBase + ".cfm.content.json",
                variation = getVariation(),
                createNewVersion = (options &amp;amp;&amp;amp; !!options.newVersion) || false;

            var data = {
                ":type": "multiple",
                ":newVersion": createNewVersion,
                "_charset_": "utf-8"
            };

            if(variation !== MASTER){
                data[":variation"] = variation;
            }

            var request = {
                url: url,
                method: "post",
                dataType: "json",
                data: _.merge(data, mfsData),
                cache: false
            };

            CFM.RequestManager.schedule({
                request: request,
                type: CFM.RequestManager.REQ_BLOCKING,
                condition: CFM.RequestManager.COND_EDITSESSION,
                ui: (options &amp;amp;&amp;amp; options.ui)
            })
        }
    }

    function getMultifieldData(){
        var $composites = $(COMPOSITE_MF_SEL), value,
            mfData = {}, values, $fields;

        _.each($composites, function(mField){
            values = [];

            _.each(mField.items.getAll(), function(item) {
                $fields = $(item.content).find("[name]");

                value = {};

                _.each($fields, function(field){
                    if(canbeSkipped(field)){
                        return;
                    }

                    value[getNameDotSlashRemoved(field.getAttribute("name"))] =  getFieldValue(field);
                });

                values.push(JSON.stringify(value));
            });

            mfData[ getNameDotSlashRemoved(($(mField)).attr(MF_NAME_ATTR))] = values;
        });

        return mfData;
    }

    function getFieldValue(field){
        var value;

        if( field.tagName == "CORAL-CHECKBOX"){
            value = field.checked ? field.getAttribute("value") : "";
        }else{
            value = field.value;
        }

        return value;
    }

    function canbeSkipped(field){
        return (($(field).attr("type") == "hidden") || (field.type == "checkbox"));
    }

    function getNameDotSlashRemoved(name){
        if(_.isEmpty(name)){
            return name;
        }

        const indexOfLastSlash = name.lastIndexOf("/");
		return (indexOfLastSlash === -1) ? name : name.substr(indexOfLastSlash + 1);
    }
}(jQuery));&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Sep 2021 14:19:34 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/422001#M120162</guid>
      <dc:creator>prashantonkar</dc:creator>
      <dc:date>2021-09-07T14:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/422006#M120164</link>
      <description>&lt;P&gt;&lt;LI-USER uid="11951465"&gt;&lt;/LI-USER&gt;&amp;nbsp;: Thanks for reply. I have tested multi-field the same way and it is working as expected in the Content Fragment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my question is related to nested-multi field.I think the code that you shared it seems its for multifield.&lt;/P&gt;&lt;P&gt;JS code that you shared so is it for multifield or nested-multifield???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 14:32:46 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/422006#M120164</guid>
      <dc:creator>kchaurasiya</dc:creator>
      <dc:date>2021-09-07T14:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/422383#M120300</link>
      <description>&lt;P&gt;&lt;LI-USER uid="14296237"&gt;&lt;/LI-USER&gt; &amp;nbsp;Good to see you back inside the AEM Community. Keep the great work of assisting others going. Looking forward to more contributions from you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 08:07:42 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/422383#M120300</guid>
      <dc:creator>kautuk_sahni</dc:creator>
      <dc:date>2021-09-09T08:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/435160#M124176</link>
      <description>&lt;P&gt;Instead of using the following&amp;nbsp;sling:resourceType ,&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;DIV class=""&gt;sling:resourceType&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;granite/ui/components/coral/foundation/form/multifield&lt;BR /&gt;&lt;SPAN&gt;granite/ui/components/foundation/form/multifield&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;use the resourceType :&amp;nbsp;&lt;STRONG&gt;dam/cfm/admin/components/authoring/contenteditor/cfmmultifield&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 09:21:23 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/435160#M124176</guid>
      <dc:creator>rsGokulraj4</dc:creator>
      <dc:date>2021-12-21T09:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/456421#M131371</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="13026194"&gt;&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you found any solution for the scenario you mentioned above, if so kindly share the solution so that we can try from our side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Jun 2022 13:00:25 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/456421#M131371</guid>
      <dc:creator>akcena_07</dc:creator>
      <dc:date>2022-06-15T13:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Multifield in Content Fragment - AEM 6.5 ?</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/542513#M134714</link>
      <description>&lt;P&gt;&lt;LI-USER uid="14296237"&gt;&lt;/LI-USER&gt;&amp;nbsp;can you help me in referencing one content fragment with another?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 10:58:37 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-content-fragment-aem-6-5/m-p/542513#M134714</guid>
      <dc:creator>priyak</dc:creator>
      <dc:date>2022-08-24T10:58:37Z</dc:date>
    </item>
  </channel>
</rss>

