Refresh page after editing component

Avatar

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile
Shaheena_Sheikh
Level 2

11-03-2021

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?

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

11-03-2021

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

 

Answers (2)

Answers (2)

Avatar

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

275 likes

Total Posts

320 posts

Correct reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

12-03-2021

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

Avatar

Avatar
Affirm 50
MVP
Vaibhavi
MVP

Likes

216 likes

Total Posts

181 posts

Correct reply

61 solutions
Top badges earned
Affirm 50
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Affirm 50
MVP
Vaibhavi
MVP

Likes

216 likes

Total Posts

181 posts

Correct reply

61 solutions
Top badges earned
Affirm 50
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
Vaibhavi
MVP

11-03-2021

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()