Force a refresh after change property of a component | Community
Skip to main content
TrifaCh
Level 2
September 15, 2023

Force a refresh after change property of a component

  • September 15, 2023
  • 3 replies
  • 2410 views

Hi Teachers,

 

I am writing to ask a question about force refreshing after change the property of a component.

 

Background:

There is a dialog window which belongs to a component contains a multi-field component. I try to add the collapse function in the task. 


Problem:

In the task I create a new component and create js in the dialog-clientlib. After finishing the task all thing goes fine. But the page will refresh automatically and cannot be edited when I click "tick" at the right top corner. The AEM System Edit page will reload and become uneditable. Why does the things happen ?
However, all things will go normally after I refresh the page again.

 

Thank you.

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

3 replies

A_H_M_Imrul
Community Advisor
Community Advisor
September 15, 2023

Hello @trifach,

 

Please check if there is any cq:EditListenersConfig within the component. If so, that can be the reason of possible refresh after edit. You can remove it to stop the refresh, and then you can debug your custom code for the component. when you debug look for any possibility of infinite looping (or circular event trigger within JS).  

 

https://helpx.adobe.com/experience-manager/kb/RefreshPageWhenModifyDialog.html

 

Thanks 

 

TrifaCh
TrifaChAuthor
Level 2
September 18, 2023

Thank you very much.

However, I cannot find the property in my component. I think there should be some event triggered by the custom js.

aanchal-sikka
Community Advisor
Community Advisor
September 15, 2023

@trifach 

 

This might be an issue specific with your component. I have not seen this discrepancy.

The cq:listeners which generally used to refresh page on component edit, have many trigger events. Can you please check if it is set to afteredit=REFRESH_PAGE. 

If not, can you please try adding and check.

 

http://www.sgaemsolutions.com/2019/01/ootbcustom-cqlisteners-in-cqeditconfig.html

Aanchal Sikka
TrifaCh
TrifaChAuthor
Level 2
September 18, 2023

Thank you for instruction. I will check my custom js code and try to handle the event listener in the self-defined module.

kautuk_sahni
Community Manager
Community Manager
September 18, 2023

@trifach 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.

Kautuk Sahni