Solved
Multifield dropdown in AEM 6.5 show hide
- January 10, 2024
- 2 replies
- 1054 views
<dummyMultifield
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true">
<field
granite:class="cmp-teaser__editor-action"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./dummyMultifield">
<items jcr:primaryType="nt:unstructured">
<text
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Text"
name="./text"
required="{Boolean}true"
value="Temp"/>
<dummyProgram
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
class="cq-dialog-dropdown-showhide"
cq-dialog-dropdown-showhide-target=".other-showhide-target"
name="./dummyProgram"
fieldLabel="Dummy Program"
required="{Boolean}false">
<items
jcr:primaryType="nt:unstructured">
<ABC
jcr:primaryType="nt:unstructured"
text="ABC"
value="abc"
selected="{Boolean}true"/>
<MNP
jcr:primaryType="nt:unstructured"
text="MNP"
value="mnp"/>
<XYZ
jcr:primaryType="nt:unstructured"
text="XYZ"
value="xyz"/>
</items>
<value>ABC</value>
</dummyProgram>
<dropdownProgram
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container"
class="hide other-showhide-target"
showhidetargetvalue="xyz">
<items jcr:primaryType="nt:unstructured">
<type
granite:class="pdfviewer-type-selector"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
fieldLabel="Type"
name="./type">
<items jcr:primaryType="nt:unstructured">
<fullWindow
jcr:primaryType="nt:unstructured"
text="Full Window"
value="FULL_WINDOW"/>
<sizedContainer
jcr:primaryType="nt:unstructured"
text="Sized Container"
value="SIZED_CONTAINER"/>
<inline
jcr:primaryType="nt:unstructured"
text="In-Line"
value="IN_LINE"/>
</items>
</type>
</items>
</dropdownProgram>
</items>
</field>
</dummyMultifield>
Above is the XML code in AEM 6.5
When you select the XYZ dropdown then and only then dropdownProgram Dropdown should be visible and its working.
But what issue I'm facing is consider in 1st multifield you select the ABC dropdown, now click on add and
to add the new multifield in that I will select XYZ dropdown so in that case dropdownProgram Dropdown is visble.
but its also visble in first multifield dropdown where the select value is ABC.
Could you help me to fix this