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>
Solved! Go to Solution.
Hi,
As couple of ways i can think of here are:-
1. Using Touch UI vvalidation [Clear method] :- http://www.nateyolles.com/blog/2016/02/aem-touch-ui-custom-validation
2. As mentioned by Pawan to write listener. https://helpx.adobe.com/experience-manager/using/creating-touchui-dynamic.html
~kautuk
yes, you have to write listener on selection change and clear whichever field value you want or modify. refer below
https://helpx.adobe.com/experience-manager/using/creating-touchui-events.html
https://helpx.adobe.com/experience-manager/using/creating-touchui-dynamic.html
Hi,
As couple of ways i can think of here are:-
1. Using Touch UI vvalidation [Clear method] :- http://www.nateyolles.com/blog/2016/02/aem-touch-ui-custom-validation
2. As mentioned by Pawan to write listener. https://helpx.adobe.com/experience-manager/using/creating-touchui-dynamic.html
~kautuk
Hey there,
I'm looking for the same solution but it seems the original links that you provided are now dead. Is there another way to these solutions or have they been scrubbed from the Adobe site?
All the best,
-TSmalley
Views
Replies
Total Likes
Thanks everyone
Views
Replies
Total Likes
Any idea how to clear selection fields in classic ui?
Views
Replies
Total Likes
You should be able to create a listener and use the reset() method on the fields.
Views
Replies
Total Likes
Views
Likes
Replies