Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Refresh only particular component after the edits instead of entire page refresh

Avatar

Community Advisor

How can we refresh only a specific component after the component edits? instead of the entire page. 

 

we have to generate the images based on dialogue edits right now by using the afteredit.. its refreshing entire page instead of only that component. 

 

Is there any better way to refresh only that component instead of.. refreshing entire page.

 

Thanks In Advance.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @Umamaheswari_Yakkala,

Within your source code, locate your component, and edit the _cq_editConfig.xml, and replace with:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    cq:disableTargeting="{Boolean}true"
    jcr:primaryType="cq:EditConfig">
    <cq:listeners
        jcr:primaryType="cq:EditListenersConfig"
        afteredit="REFRESH_SELF"/>
</jcr:root>

 

Or, within the JCR, you can locate your component/cq:editConfig/cq:listeners, to add a new property of "afteredit" to "REFRESH_SELF".

 

The SGAEMSolutions blog provides a very good tutorial (++included, video tutorial) and explanation for cq:listeners in cq:editConfig. There are much more options than refreshing a single component after an edit, check it out here - http://www.sgaemsolutions.com/2019/01/ootbcustom-cqlisteners-in-cqeditconfig.html

View solution in original post

4 Replies

Avatar

Community Advisor

Please check cq:listeners at https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/components-basics.html#EditBeh...

 

e.g.

 

 

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:EditConfig">
    <cq:listeners
        jcr:primaryType="cq:EditListenersConfig"
        afteredit="REFRESH_SELF"/>
</jcr:root>

 

 



Arun Patidar

Avatar

Community Advisor

This is not working. We are generating an image based on JSON... when I tried using Refresh_self it's not working. Is there any other way can we do ?

Avatar

Community Advisor
You can try with REFRESH_PARENT otherwise you have to rely on REFRESH_PAGE


Arun Patidar

Avatar

Correct answer by
Community Advisor

Hello @Umamaheswari_Yakkala,

Within your source code, locate your component, and edit the _cq_editConfig.xml, and replace with:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    cq:disableTargeting="{Boolean}true"
    jcr:primaryType="cq:EditConfig">
    <cq:listeners
        jcr:primaryType="cq:EditListenersConfig"
        afteredit="REFRESH_SELF"/>
</jcr:root>

 

Or, within the JCR, you can locate your component/cq:editConfig/cq:listeners, to add a new property of "afteredit" to "REFRESH_SELF".

 

The SGAEMSolutions blog provides a very good tutorial (++included, video tutorial) and explanation for cq:listeners in cq:editConfig. There are much more options than refreshing a single component after an edit, check it out here - http://www.sgaemsolutions.com/2019/01/ootbcustom-cqlisteners-in-cqeditconfig.html