Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Customise delete dialog for a component.

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

7 Replies

Avatar

Level 10

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

Avatar

Community Advisor

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

Avatar

Level 2

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

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 2

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

Avatar

Level 1

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