Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Multifield inside multifield is not populating content in dialog upon load

Avatar

Level 6

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root 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="cq:Dialog"
    fieldLabel="Navigation"
    title="dialog"
    xtype="dialog">
    <items
        jcr:primaryType="cq:Widget"
        xtype="tabpanel">
        <items jcr:primaryType="cq:WidgetCollection">
            <tools
                jcr:primaryType="cq:Panel"
                title="Tools"
                xtype="panel">
                <items jcr:primaryType="cq:WidgetCollection">
                    <tools_slides
                        jcr:primaryType="cq:Widget"
                        baseName="toolsitem_"
                        fieldLabel="Tools "
                        name="./toolsslides"
                        width="900"
                        xtype="multimulticompositefield">
                        <fieldConfigs jcr:primaryType="cq:WidgetCollection">
                            <sectionName
                                jcr:primaryType="cq:Widget"
                                allowBlank="{Boolean}false"
                                fieldLabel="Section Name"
                                name="sectionName"
                                width="840"
                                xtype="textfield"/>
                            <description
                                jcr:primaryType="cq:Widget"
                                fieldLabel="Description"
                                name="description"
                                width="840"
                                xtype="textfield"/>
                            <education_slides
                                jcr:primaryType="cq:Widget"
                                baseName="sectionelementsitem_"
                                fieldLabel="Tools Section Elements"
                                name="toolssectionelements"
                                width="800"
                                xtype="multimulticompositefield">
                                <fieldConfigs jcr:primaryType="cq:WidgetCollection">
                                    <title
                                        jcr:primaryType="cq:Widget"
                                        allowBlank="{Boolean}false"
                                        fieldLabel="Title"
                                        name="title"
                                        width="430"
                                        xtype="textfield"/>
                                    <linkType
                                        jcr:primaryType="cq:Widget"
                                        fieldLabel="New Window?"
                                        name="linkType"
                                        type="checkbox"
                                        xtype="checkbox"/>
                                    <iconUrl
                                        jcr:primaryType="cq:Widget"
                                        fieldLabel="Icon Image"
                                        name="iconUrl"
                                        width="430"
                                        xtype="pathfield">
                                        <treeRoot
                                            jcr:primaryType="nt:unstructured"
                                            name="content/dam"
                                            text="Brocade DAM"/>
                                    </iconUrl>
                                    <description
                                        jcr:primaryType="cq:Widget"
                                        fieldLabel="Description"
                                        name="description"
                                        width="430"
                                        xtype="textfield"/>
                                </fieldConfigs>
                            </education_slides>
                        </fieldConfigs>
                    </tools_slides>
                </items>
            </tools>
            <education
                jcr:primaryType="cq:Panel"
                title="Education"
                xtype="panel">
                <items jcr:primaryType="cq:WidgetCollection">
                    <education_slides
                        jcr:primaryType="cq:Widget"
                        baseName="item_"
                        fieldLabel="Education"
                        name="./educationslides"
                        width="900"
                        xtype="multimulticompositefield">
                        <fieldConfigs jcr:primaryType="cq:WidgetCollection">
                            <section_name
                                jcr:primaryType="cq:Widget"
                                fieldLabel="Section"
                                name="section_name"
                                type="radiogroup"
                                width="840"
                                xtype="selection">
                                <options jcr:primaryType="cq:WidgetCollection">
                                    <education
                                        jcr:primaryType="nt:unstructured"
                                        checked="{Boolean}true"
                                        text="Education"
                                        value="Education"/>
                                </options>
                            </section_name>
                            <title
                                jcr:primaryType="cq:Widget"
                                allowBlank="{Boolean}false"
                                fieldLabel="Title"
                                name="title"
                                width="840"
                                xtype="textfield"/>
                            <titleCode
                                jcr:primaryType="cq:Widget"
                                allowBlank="{Boolean}false"
                                fieldLabel="Title Code"
                                name="titleCode"
                                regex="/^[A-Za-z0-9-_/.]+$/"
                                regexText="Only alphanumeric with -, _ and / allowed."
                                width="840"
                                xtype="textfield">
                                <listeners
                                    jcr:primaryType="nt:unstructured"
                                    blur="function() {&#xa;&#x9;var inputs = {};&#xa;&#x9;var duplicate = false;&#xa;&#x9;$(&quot;input[name$='titleCode']&quot;).each(function() {&#xa;    if (inputs[this.value] !== undefined) {&#xa;      $([this, inputs[this.value]]).addClass('same');&#xa;        alert(&quot;Title Code should be unique: &quot;+this.value)&#xa;&#x9;&#x9;duplicate = true;&#xa;&#x9;&#x9;return false;&#xa;    }&#xa;    inputs[this.value] = this;&#xa;&#x9;});&#xa;&#x9;if(duplicate) {&#xa;&#x9;&#x9;return false;&#xa;&#x9;}else{&#x9;&#x9;&#xa;&#x9;&#x9;if(this.getValue() != ''){&#xa;&#x9;&#x9;&#x9;if(this.getValue().match(/^[A-Za-z0-9-_/.]+$/)){&#xa;&#x9;&#x9;&#x9;&#x9;this.setReadOnly(true);&#xa;&#x9;&#x9;&#x9;}else{&#xa;&#x9;&#x9;&#x9;&#x9;alert('Title Code should be alphanumerics, - and _ only');&#xa;&#x9;&#x9;&#x9;}&#x9;&#x9;&#x9;&#xa;&#x9;&#x9;}&#xa;&#x9;}&#xa;}"/>
                            </titleCode>
                            <linkType
                                jcr:primaryType="cq:Widget"
                                fieldLabel="New Window?"
                                name="linkType"
                                type="checkbox"
                                xtype="checkbox"/>
                            <description
                                jcr:primaryType="cq:Widget"
                                fieldLabel="Description"
                                name="description"
                                width="840"
                                xtype="textfield"/>
                        </fieldConfigs>
                    </education_slides>
                </items>
            </education>
        </items>
    </items>
    <listeners
        jcr:primaryType="nt:unstructured"
        beforesubmit="function(dialog) {&#xa;var duplicate = false;&#xa;var inputs = {};&#xa;&#x9;$(&quot;input[name$='titleCode']&quot;).each(function() {&#xa;    if (inputs[this.value] !== undefined) {&#xa;      $([this, inputs[this.value]]).addClass('same');&#xa;        alert(&quot;Title Code should be unique: &quot;+this.value);&#xa;&#x9;&#x9;duplicate = true;&#xa;&#x9;&#x9;return false;&#xa;    }&#xa;    inputs[this.value] = this;&#x9;&#xa;&#x9;});  &#xa;if(duplicate) {&#xa;&#x9;return false;&#xa;}&#xa;}"
        loadcontent="function() {   &#xa;    $(&quot;input[name$='titleCode']&quot;).attr('readonly', true);&#xa;    $(&quot;input[name$='titleCode']&quot;).css({&quot;background-color&quot;:&quot;#EBEBE4&quot;, &quot;color&quot;:&quot;#ccc&quot;});&#xa;}"/>
</jcr:root>

2 Replies