Expand my Community achievements bar.

Dropdown selection in multifield is not retaining the authored values

Avatar

Level 1

I have created a dialog with a multifield where the first item is a dropdown selection on selection of the value the next items are populated. The dropdown options are DM video/ Youtue video. If the selection is DM video it will populate title, video path filed and image path filld. If its a YT Video the next items title, youtube link and the image path filed populates. For the first time I have authored they are correctly storing at the node level and in dialog too, But when I open the dialog for the second time the author values are mixing with not rightly selected dropdown. The YT fileds are set to DM or viceversa The below attached is the dialog xml, pls suggest.

nagalaxmithangellapally_0-1622124981355.png

 

    jcr:primaryType="nt:unstructured"
    jcr:title="Videos"
    sling:resourceType="cq/gui/components/authoring/dialog"
    mode="edit">
    <content
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/coral/foundation/container">
        <items jcr:primaryType="nt:unstructured">
            <tabs
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/tabs"
                maximized="{Boolean}true">
                <items jcr:primaryType="nt:unstructured">
                    <videos-selection
                        jcr:primaryType="nt:unstructured"
                        jcr:title="Videos"
                        sling:resourceType="granite/ui/components/coral/foundation/container"
                        margin="{Boolean}true">
                        <items jcr:primaryType="nt:unstructured">
                            <columns
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"
                                margin="{Boolean}true">
                                <items jcr:primaryType="nt:unstructured">
                                    <column
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/coral/foundation/container">
                                        <items jcr:primaryType="nt:unstructured">
                                            <defaultnumofvideo
                                                jcr:primaryType="nt:unstructured"
                                                sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
                                                fieldDescription="Default number of videos to show"
                                                fieldLabel="Default Number of Videos"
                                                min="{Long}0"
                                                name="./deafaultnumber"/>
                                            <videos
                                                jcr:primaryType="nt:unstructured"
                                                sling:resourceType="granite/ui/components/coral/foundation/container">
                                                <items jcr:primaryType="nt:unstructured">
                                                    <cta-column
                                                        jcr:primaryType="nt:unstructured"
                                                        sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
                                                        composite="{Boolean}true"
                                                        eaem-show-on-collapse="EAEM.showProductName"
                                                        fieldDescription="Click add button to add Videos"
                                                        fieldLabel="Videos">
                                                        <field
                                                            jcr:primaryType="nt:unstructured"
                                                            sling:resourceType="granite/ui/components/coral/foundation/container"
                                                            name="./videos">
                                                            <items jcr:primaryType="nt:unstructured">
                                                                <column
                                                                    jcr:primaryType="nt:unstructured"
                                                                    sling:resourceType="granite/ui/components/coral/foundation/container">
                                                                    <items jcr:primaryType="nt:unstructured">
                                                                        <list-from
                                                                            granite:class="cq-dialog-dropdown-showhide"
                                                                            jcr:primaryType="nt:unstructured"
                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/select"
                                                                            fieldLabel="Build Videos List"
                                                                            name="./listFrom">
                                                                            <granite:data
                                                                                jcr:primaryType="nt:unstructured"
                                                                                cq-dialog-dropdown-showhide-target=".list-option-listfrom-showhide-target"/>
                                                                            <items jcr:primaryType="nt:unstructured">
                                                                                <dm-video
                                                                                    jcr:primaryType="nt:unstructured"
                                                                                    text="DM-Video"
                                                                                    value="dmvideo"/>
                                                                                <yt-video
                                                                                    jcr:primaryType="nt:unstructured"
                                                                                    text="Youtube Video"
                                                                                    value="ytvideo"/>
                                                                            </items>
                                                                        </list-from>
                                                                        <isnewwindow
                                                                            jcr:primaryType="nt:unstructured"
                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
                                                                            fieldDescription="Option to open Link in a new tab"
                                                                            name="./isOpenNewWindow"
                                                                            text="Open In New Window"
                                                                            value="true"/>
                                                                        <dmvideos
                                                                            granite:class="hide list-option-listfrom-showhide-target foundation-layout-util-vmargin"
                                                                            jcr:primaryType="nt:unstructured"
                                                                            sling:resourceType="granite/ui/components/coral/foundation/container">
                                                                            <granite:data
                                                                                jcr:primaryType="nt:unstructured"
                                                                                showhidetargetvalue="dmvideo"/>
                                                                            <items jcr:primaryType="nt:unstructured">
                                                                                <heading
                                                                                    granite:class="coral-Heading coral-Heading--4"
                                                                                    jcr:primaryType="nt:unstructured"
                                                                                    sling:resourceType="granite/ui/components/coral/foundation/heading"
                                                                                    level="{Long}4"
                                                                                    text="Dynamic Media Videos"/>
                                                                                <well
                                                                                    jcr:primaryType="nt:unstructured"
                                                                                    sling:resourceType="granite/ui/components/coral/foundation/well">
                                                                                    <items jcr:primaryType="nt:unstructured">
                                                                                        <vid-title
                                                                                            jcr:primaryType="nt:unstructured"
                                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                                                            fieldDescription="Text that will appear in the video"
                                                                                            fieldLabel="DM Video Title"
                                                                                            name="./dmvidTitle"/>
                                                                                        <vidpath
                                                                                            jcr:primaryType="nt:unstructured"
                                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                                                                                            fieldDescription="The path for the videos"
                                                                                            fieldLabel="DM Videos Path"
                                                                                            name="./dmvidpath"
                                                                                            rootPath="/content/dam/cargill/dm-assets/asphaltsolutions/videos"/>
                                                                                        <previewimgpath
                                                                                            jcr:primaryType="nt:unstructured"
                                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                                                                                            fieldDescription="The path for the video preview image"
                                                                                            fieldLabel="Video Preview Image"
                                                                                            name="./vidpreviewimg"
                                                                                            rootPath="/content/dam/cargill/dm-assets/asphaltsolutions/images"/>
                                                                                    </items>
                                                                                </well>
                                                                            </items>
                                                                        </dmvideos>
                                                                        <ytvideos
                                                                            granite:class="hide list-option-listfrom-showhide-target foundation-layout-util-vmargin"
                                                                            jcr:primaryType="nt:unstructured"
                                                                            sling:resourceType="granite/ui/components/coral/foundation/container">
                                                                            <granite:data
                                                                                jcr:primaryType="nt:unstructured"
                                                                                showhidetargetvalue="ytvideo"/>
                                                                            <items jcr:primaryType="nt:unstructured">
                                                                                <heading
                                                                                    granite:class="coral-Heading coral-Heading--4"
                                                                                    jcr:primaryType="nt:unstructured"
                                                                                    sling:resourceType="granite/ui/components/coral/foundation/heading"
                                                                                    level="{Long}4"
                                                                                    text="Youtube Videos"/>
                                                                                <well
                                                                                    jcr:primaryType="nt:unstructured"
                                                                                    sling:resourceType="granite/ui/components/coral/foundation/well">
                                                                                    <items jcr:primaryType="nt:unstructured">
                                                                                        <vid-title
                                                                                            jcr:primaryType="nt:unstructured"
                                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                                                            fieldDescription="Text that will appear in the video"
                                                                                            fieldLabel="YT Video Title"
                                                                                            name="./ytvidTitle"/>
                                                                                        <ytvid-url
                                                                                            jcr:primaryType="nt:unstructured"
                                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                                                            fieldDescription="Youtube Video URL"
                                                                                            fieldLabel="YT Video URL"
                                                                                            name="./ytvidURL"/>
                                                                                        <previewimgpath
                                                                                            jcr:primaryType="nt:unstructured"
                                                                                            sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                                                                                            fieldDescription="The path for the video preview image"
                                                                                            fieldLabel="YT Video Preview Image"
                                                                                            name="./ytvidpreviewimg"
                                                                                            rootPath="/content/dam/cargill/dm-assets/asphaltsolutions/images"/>
                                                                                    </items>
                                                                                </well>
                                                                            </items>
                                                                        </ytvideos>
                                                                    </items>
                                                                </column>
                                                            </items>
                                                        </field>
                                                        <granite:data
                                                            jcr:primaryType="nt:unstructured"
                                                            max-items="10"/>
                                                    </cta-column>
                                                </items>
                                            </videos>
                                            <showonloadmore
                                                jcr:primaryType="nt:unstructured"
                                                sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
                                                fieldDescription="Number of videos to show on load more"
                                                fieldLabel="Number of videos to show on load more"
                                                min="{Long}0"
                                                name="./loadmorenumber"/>
                                        </items>
                                    </column>
                                </items>
                            </columns>
                        </items>
                    </videos-selection>
                </items>
            </tabs>
        </items>
    </content>
</jcr:root>

 

 

@kautuk_sahni @Kautuksahni @arunpatidar26 

1 Reply