@vaibhavi_j
There is chance of race condition because form submit is async POST call and submit is a call back function. @veenavikraman 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_j approach, but
- Page will be reloaded like you refresh the page.
- You should not use dialog submit click event, but should use dialog-success. Which will be executed if dialog POST action is successful.
- Instead of setting flag attach event only if field is updated.