How can I clear data from dialog when user picks a different granite select?
Hello
Working on a dialog box and I have a select box with two options. How can I clear the previous data when a user comes back into the dialog and selects the other option? I think this may requires some clientside js, but I want double check.
<cta1InternalExternalSelect jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/select" class="cq-dialog-dropdown-showhide" cq-dialog-dropdown-showhide-target=".list-option-listfrom-showhide-target" fieldLabel="Internal or External?" name="./slide1cta1internalExternalSelect"> <items jcr:primaryType="nt:unstructured"> <internal jcr:primaryType="nt:unstructured" text="Internal" value="slide1Cta1Internal"/> <external jcr:primaryType="nt:unstructured" text="External" value="slide1Cta1External"/> </items> </cta1InternalExternalSelect> <cta1SetInternal jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container" class="hide list-option-listfrom-showhide-target foundation-layout-util-vmargin" showhidetargetvalue="slide1Cta1Internal"> <items jcr:primaryType="nt:unstructured"> <heading jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/heading" class="coral-Heading coral-Heading--4" level="{Long}4" text="Internal Link"/> <well jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/layouts/well"/> <items jcr:primaryType="nt:unstructured"> <internalLink jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/pathbrowser" fieldLabel="Internal Link" name="./slide1Cta1InternalLink" rootPath="/content"/> </items> </well> </items> </cta1SetInternal> <cta1SetExternal jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container" class="hide list-option-listfrom-showhide-target foundation-layout-util-vmargin" showhidetargetvalue="slide1Cta1External"> <items jcr:primaryType="nt:unstructured"> <heading jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/heading" class="coral-Heading coral-Heading--4" level="{Long}4" text="External Link"/> <well jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/container"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/layouts/well"/> <items jcr:primaryType="nt:unstructured"> <externalLink jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/foundation/form/textfield" fieldLabel="External Link" fieldDescription="You need to include full link including https or http" name="./slide1Cta1ExternalLink"/> </items> </well> </items> </cta1SetExternal>