below is my scenario, card variation has three options Image on top, BG-Image and No Image. the card size field shoukld display only on Image on top variation. for this
dialog structure, for cardSize node I added granite:datanode
with value cq-dialog-showhide-target = .showhidetopImage
eventhoug I provided showhidetargetvalue String[] topImage,cardSize. its not working as expected
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Anilkumar9 ,
Please try to align your configuration based on this example:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/tabs">
<items jcr:primaryType="nt:unstructured">
<settings
jcr:primaryType="nt:unstructured"
jcr:title="Config 1"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<variation
granite:class="cq-dialog-dropdown-showhide"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
name="./variation">
<items jcr:primaryType="nt:unstructured">
<backgroundImage
jcr:primaryType="nt:unstructured"
text="Background image"
value="backgroundImage"/>
<topImage
jcr:primaryType="nt:unstructured"
text="Top image"
value="topImage"/>
<noImage
jcr:primaryType="nt:unstructured"
text="No image"
value="noImage"/>
</items>
<granite:data
jcr:primaryType="nt:unstructured"
cq-dialog-dropdown-showhide-target=".card-variation-showhide-target"/>
</variation>
<cardSizeContainer
granite:class="hide card-variation-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="topImage"/>
<items jcr:primaryType="nt:unstructured">
<variation
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
name="./cardSize">
<items jcr:primaryType="nt:unstructured">
<medium
jcr:primaryType="nt:unstructured"
text="Medium"
value="medium"/>
<large
jcr:primaryType="nt:unstructured"
text="Large"
value="large"/>
</items>
</variation>
</items>
</cardSizeContainer>
</items>
</column>
</items>
</settings>
</items>
</content>
</jcr:root>
Seems like you places granite:data node in a wrong location. It should not be under items. It's like an extension for field.
Refer other documentation: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/show-hide-fields-based-on-...
Best regards,
Kostiantyn Diachenko.
Hi @Anilkumar9
From the screenshots you posted, i can see that granite:data has to be placed under cardsize node instead of items. Please try to replace the placement of node. Check if it resolves
If issue still persists, please post your content.xml file
Thanks
Prathyusha
Views
Replies
Total Likes
Hi @PRATHYUSHA_VP
As you said I changed the position of granite:data node but still no luck. can you please look into .xml
Views
Replies
Total Likes
hi @Anilkumar9
Re-checked your dialog structure, classes for hide and show values are not assigned as expected. please check the attached file and try to update same
Same example can be found in core components list component :
Update if it works
Thanks,
Prathyusha
Views
Replies
Total Likes
Hi @Anilkumar9,
please compare how did I configure cardSizeContainer in the dialog example above with your cardsize field. Pay attention to the granite:data properties.
Views
Replies
Total Likes
@Anilkumar9 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies