Customise delete dialog for a component. | Community
Skip to main content
Level 2
August 1, 2018
Solved

Customise delete dialog for a component.

  • August 1, 2018
  • 7 replies
  • 6027 views

Hi,

Is there a way in AEM that you can cusomise the delete dialog for a component?

What I'm am aiming to do is to detect if there is a content reference to the component that is about to be deleted.  And would like to display in the delete dialog itself a list of paths where it is being reference elsewhere on the site.  Thus the user can decide if the delete is a wise choice or not.

I have managed to hook into the 'beforedelete' in the 'EditListenersConfig', but that will only trigger when the 'delete' button is pressed.  So not ideal.

Thanks,

David Miller

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

Yes, if you want for a component you can do it with 'beforedelete' in the 'EditListenersConfig'

and present another coral alert using javascript Documentation | CoralUI

Thansk

Arun

7 replies

smacdonald2008
Level 10
August 1, 2018

Are you referring to a dialog option that pops up when you want to delete a component from a web page in Edit Mode?

arunpatidar
Community Advisor
Community Advisor
August 1, 2018

Hi,

What do you mean by delete dialog? can you share example.

Anyways you can customise any dialog for example if you want to display the the page where particular component is referred, then you can create o'clock event on delete button and make a Ajax call to sling servlet which runs query against your criteria sends back the results at UI and you can display those results in dialog.

Thanks

Arun

Arun Patidar
Level 2
August 2, 2018

Yes, the delete dialog for a component is the dialog option that pops up when you want to delete a component.

And, yes the intention was to make an Ajax call to a sling servlet to run the query I needed.

But what is and how to do make an "o'clock event"?  

I wouldn't want it on the delete button, as that would mean I would need to present another pop up with the information.  (I have figured out how to do that anyway with the 'beforedelete' in the 'EditListenersConfig' as per the op.)

I ideally want to present the information in the delete dialog itself.

Thanks, David

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 2, 2018

Yes, if you want for a component you can do it with 'beforedelete' in the 'EditListenersConfig'

and present another coral alert using javascript Documentation | CoralUI

Thansk

Arun

Arun Patidar
smacdonald2008
Level 10
August 2, 2018

Nice reply Arun!

Level 2
August 2, 2018

Ah ok, so that's for Coral UI3. 
I happen to be on AEM 6.1 and I'm struggling to find the same JS examples.
AEM 6.1 | CoralUI

August 25, 2019

Hi @davidm91035638 @Arun Patidar

Did you got any solution for this.If Yes could you please provide me some refrence example or solution for this.

Thanks in advance