Custom script is not rendering on AEM dialog | Community
Skip to main content
Prince_Shivhare
Community Advisor
Community Advisor
February 23, 2023
Solved

Custom script is not rendering on AEM dialog

  • February 23, 2023
  • 1 reply
  • 693 views

Hey Guys,

I have written some custom logic on dialog level to show some images.

For example - I have a product code which is authorable in the component dialog, now once someone selects the product code in dialog, I am previewing the image just below the select field. I am using granite:class and showing it.

but once I close the dialog and reopen it, the image is not visible.

 

I tried with all types of dialog-ready conditions but nothing is working out. Can someone suggest how can I retain the image in dialog?

 

Thanks,

Prince

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi prince,

 

You may need to write the same login on foundtaion-contentload event as well.

$document.on("foundation-contentloaded", function (e) { fetchProductImage(onLoadFlag); }); $document.on("change", contentTypeSelector, function (e) { fetchProductImage(!onLoadFlag); });

 

I implemented something similar for the dynamic dropdown https://aemlab.blogspot.com/2022/01/aemaacs-touch-ui-dialog-dynamic-dropdown.html 

 

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
February 23, 2023

Hi prince,

 

You may need to write the same login on foundtaion-contentload event as well.

$document.on("foundation-contentloaded", function (e) { fetchProductImage(onLoadFlag); }); $document.on("change", contentTypeSelector, function (e) { fetchProductImage(!onLoadFlag); });

 

I implemented something similar for the dynamic dropdown https://aemlab.blogspot.com/2022/01/aemaacs-touch-ui-dialog-dynamic-dropdown.html 

 

Arun Patidar