Dialog show-hide tabs not working OOTB
I was trying to achieve dialog show/hide tabs scenario based on a select field and was referring the below article but it doesn't work. Can someone clarify if dialog show/hide works OOTB or we always need to write custom JS?
https://blog.3sharecorp.com/show-and-hide-dialog-fields-based-on-any-field-type
<?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="nt:unstructured"
jcr:title="Show/Hide - Tab"
sling:resourceType="cq/gui/components/authoring/dialog"
extraClientlibs="[dialog.utils]">
<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"
maxmized="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<component-variation
jcr:primaryType="nt:unstructured"
jcr:title="Component Variation"
sling:resourceType="granite/ui/components/coral/foundation/container"
margin="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<variation
granite:class="cq-dialog-showhide"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
fieldDescription="Select the location for this component."
fieldLabel="Variation"
name="./variation">
<granite:data
jcr:primaryType="nt:unstructured"
cq-dialog-showhide-target=".select-showhide-target"/>
<items jcr:primaryType="nt:unstructured">
<landing-page
jcr:primaryType="nt:unstructured"
text="Landing Page (default)"
value="landing-page"/>
<detail-page
jcr:primaryType="nt:unstructured"
text="Detail Page"
value="detail-page"/>
</items>
</variation>
</items>
</component-variation>
<landing-page
granite:class="hide select-showhide-target"
jcr:primaryType="nt:unstructured"
jcr:title="Landing Page"
sling:resourceType="granite/ui/components/coral/foundation/container"
margin="{Boolean}true"
maxmized="{Boolean}true">
<granite:data
jcr:primaryType="nt:unstructured"
showhidetargetvalue="landing-page"/>
<items jcr:primaryType="nt:unstructured">
<content
jcr:primaryType="nt:unstructured"
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">
<pathfield
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
fieldLabel="Select a Content Fragment"
name="./assetPath"
rootPath="/content/dam"/>
<landingPageVariation
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
fieldDescription="Select the type of display on page."
fieldLabel="Display Type"
name="./landingPageVariation">
<items jcr:primaryType="nt:unstructured">
<banner
jcr:primaryType="nt:unstructured"
text="Banner (default)"
value="banner"/>
<teaser
jcr:primaryType="nt:unstructured"
text="Teaser"
value="teaser"/>
</items>
</landingPageVariation>
<detailsPagePath
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
fieldLabel="Details Page Path"
name="./detailsPagePath"
rootPath="/content/dotcom"/>
<ctaText
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Read More CTA Label"
name="./ctaText"/>
</items>
</column>
</items>
</content>
</items>
</landing-page>
<details-page
granite:class="hide select-showhide-target"
jcr:primaryType="nt:unstructured"
jcr:title="Details Page"
sling:resourceType="granite/ui/components/coral/foundation/container"
margin="{Boolean}true">
<granite:data
jcr:primaryType="nt:unstructured"
showhidetargetvalue="detail-page"/>
<items jcr:primaryType="nt:unstructured">
<content
jcr:primaryType="nt:unstructured"
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">
<searchResultsPagePath
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
fieldLabel="Search Results Page Path"
name="./searchResultsPagePath"
rootPath="/content/dotcom"/>
<showAuthorBio
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showAuthorBio"
text="Show Author Bio"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showCalloutInfo
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showCalloutInfo"
text="Show Callout Information"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showQuoteInfo
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showQuoteInfo"
text="Show Quote Bio"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showAuthorName
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showAuthorName"
text="Show Author Name"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showBodyContent
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showBodyContent"
text="Show Body Content"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showTitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showTitle"
text="Show Title"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showPrimaryCategory
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showPrimaryCategory"
text="Show Primary Category"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showPretitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showPretitle"
text="Show Pretitle"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showDate
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showDate"
text="Show Date"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showFeaturedImageOrVideo
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showFeaturedImageOrVideo"
text="Show Featured Image Or Video"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showSubhead
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showSubhead"
text="Show Subhead"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<showSecondaryTags
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
name="./showSecondaryTags"
text="Show Secondary Tags"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
</items>
</column>
</items>
</content>
</items>
</details-page>
</items>
</tabs>
</items>
</content>
</jcr:root>