Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Refresh page after editing component

Shaheena_Sheikh
Level 4
Level 4

I have a component with various fields in it along with image field. I want to refresh the page only when the image field is update. Right now I'm using edit:config to refresh page "afteredit". How can I refresh the page only when the image field is edited?

 

1 Accepted Solution
Anudeep_Garnepudi
Correct answer by
Community Advisor
Community Advisor

@Shaheena_Sheikh 

cq:editConfig configuration are component specific not field specific.

cq:listeners (node type cq:EditListenersConfig) : defines what happens before or after an action occurs on the component.

Documentation: https://helpx.adobe.com/in/experience-manager/6-3/sites/developing/using/components-basics.html#Edit...

 

View solution in original post

0 Replies
Anudeep_Garnepudi
Correct answer by
Community Advisor
Community Advisor

@Shaheena_Sheikh 

cq:editConfig configuration are component specific not field specific.

cq:listeners (node type cq:EditListenersConfig) : defines what happens before or after an action occurs on the component.

Documentation: https://helpx.adobe.com/in/experience-manager/6-3/sites/developing/using/components-basics.html#Edit...

 

View solution in original post

Vaibhavi
Community Advisor
Community Advisor

Hi @Shaheena_Sheikh , 

 

If you need to refresh the page on specific field edit and not for the change in other field , option would be custom listner.. 

On change of field , set a flag. If flag is true, refresh a page with 

window.location.reload()

Veena_Vikram
Community Advisor
Community Advisor
@Vaibhavi I doubt , if the page reloads before the Dialog is submitted, the changes will not be saved right ?
Vaibhavi
Community Advisor
Community Advisor

Hi @Veena_Vikram ,

 

Custom code should be on  click of submit action

Anudeep_Garnepudi
Community Advisor
Community Advisor

@Vaibhavi 

There is chance of race condition because form submit is async POST call and submit is a call back function. @Veena_Vikram point/case might be possible.

And most importantly cq:editConfig's cq:listener events will never reload the actual edit page, but the iframe(content iframe in edit mode) will be refreshed and edit overlay will be reinitialized/reset.

@Shaheena_Sheikh If you are want actually reload the actual page then you can try @Vaibhavi approach, but

  1. Page will be reloaded like you refresh the page.
  2. You should not use dialog submit click event, but should use dialog-success. Which will be executed if dialog POST action is successful.
  3. Instead of setting flag attach event only if field is updated.