Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

AEM 6.4.x + Coral3: CQ dialog show/hide not working for dropdown inside a multifield

Avatar

Level 8

Basically, the dropdown show/hide does not work. But the checkbox show/hide is working. Any ideas on how to fix?

 

Thanks

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/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="cq:Panel"
          title="Data List">
    <items jcr:primaryType="cq:WidgetCollection">
        <dependencies
                jcr:primaryType="nt:unstructured"
                jcr:title="Data Table"
                sling:resourceType="granite/ui/components/coral/foundation/container">
            <items jcr:primaryType="nt:unstructured">
                <fieldLabel
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/text"
                        text="Data Items"/>
                <well
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/well">
                    <items jcr:primaryType="nt:unstructured">
                        <dataItems
                                granite:class="portal-multifield"
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="aap2/aap2-core/touchui/form/multifield"
                                composite="{Boolean}true"
                                isMultiFieldNode="{Boolean}true">
                            <field
                                    granite:class="portal-multifield-item"
                                    jcr:primaryType="nt:unstructured"
                                    sling:resourceType="granite/ui/components/coral/foundation/container">
                                <items jcr:primaryType="nt:unstructured">
                                    <list
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="granite/ui/components/coral/foundation/form/select"
                                            class="cq-dialog-dropdown-showhide"
                                            fieldLabel="Options Type"
                                            name="./optionsType">
                                        <granite:data
                                                jcr:primaryType="nt:unstructured"
                                                cq-dialog-dropdown-showhide-target=".test-options-showhide-target"/>
                                        <items jcr:primaryType="nt:unstructured">
                                            <option1
                                                    jcr:primaryType="nt:unstructured"
                                                    text="Option1"
                                                    value="option1"/>
                                            <option2
                                                    jcr:primaryType="nt:unstructured"
                                                    text="Option2"
                                                    value="option2"/>
                                        </items>
                                    </list>
                                    <option1group
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="granite/ui/components/coral/foundation/container"
                                            granite:class="hidden test-options-showhide-target">
                                        <granite:data
                                                jcr:primaryType="nt:unstructured"
                                                showhidetargetvalue="option1"/>
                                        <items jcr:primaryType="nt:unstructured">
                                            <heading
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/heading"
                                                    class="coral-Heading coral-Heading--4"
                                                    level="{Long}4"
                                                    text="Options 1 Group"/>
                                            <well
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/coral/foundation/container">
                                                <layout
                                                        jcr:primaryType="nt:unstructured"
                                                        sling:resourceType="granite/ui/components/coral/foundation/layouts/well"/>
                                                <items jcr:primaryType="nt:unstructured">
                                                    <webUrl
                                                            jcr:primaryType="nt:unstructured"
                                                            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                            fieldLabel="Web Url"
                                                            name="./webUrl"/>
                                                </items>
                                            </well>
                                        </items>
                                    </option1group>
                                    <isEditable
                                            granite:class="cq-dialog-checkbox-showhide"
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
                                            checked="{Boolean}false"
                                            name="./isEditable"
                                            text="Is link has any condition ?"
                                            value="true">
                                        <granite:data
                                                jcr:primaryType="nt:unstructured"
                                                cq-dialog-showhide-target=".link-option-enable-showhide-target"/>
                                    </isEditable>
                                    <well
                                            granite:class="hidden link-option-enable-showhide-target"
                                            jcr:primaryType="nt:unstructured"
                                            sling:resourceType="granite/ui/components/coral/foundation/well">
                                        <granite:data
                                                jcr:primaryType="nt:unstructured"
                                                showhidetargetvalue="true"/>
                                        <items jcr:primaryType="nt:unstructured">
                                            <linkCondition
                                                    jcr:primaryType="nt:unstructured"
                                                    sling:resourceType="granite/ui/components/foundation/form/inputgroup"
                                                    fieldLabel="Link Condition">
                                                <field
                                                        jcr:primaryType="nt:unstructured"
                                                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                                        class="dependencyField"
                                                        fieldLabel="Link Condition"
                                                        name="linkCondition"/>
                                            </linkCondition>
                                        </items>
                                    </well>
                                </items>
                            </field>
                        </dataItems>
                    </items>
                </well>
            </items>
        </dependencies>
    </items>
</jcr:root>

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Probably you have made a mistake in your code

<list jcr:primaryType="nt:unstructured" 
sling:resourceType="granite/ui/components/coral/foundation/form/select"
class="cq-dialog-dropdown-showhide"
fieldLabel="Options Type"
name="./optionsType">

Here you have mentioned only "class", you didn't mention "granite:class" 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Probably you have made a mistake in your code

<list jcr:primaryType="nt:unstructured" 
sling:resourceType="granite/ui/components/coral/foundation/form/select"
class="cq-dialog-dropdown-showhide"
fieldLabel="Options Type"
name="./optionsType">

Here you have mentioned only "class", you didn't mention "granite:class"