cancel
Showing results for 
Search instead for 
Did you mean: 

How to do someting onClose of Dialog in aikau?

npavlov
Confirmed Champ
Confirmed Champ

Hi,

I create dialog by publishing "ALF_CREATE_DIALOG_REQUEST" Topic. After close the dialog I want to do some action. Now I use ALF_DIALOG_MOVE_STOP to track that event. But this event occurs also when moving dialog window. But I need my action to start only after closing dialog window.

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

Why would you want to do that? Unless the user clicks ok, why would you do anything at all?

But no worries, the DialogService supports configuration of a cancelPublishTopic which is triggered when the dialog is cancelled via the close button.

Please check the Aikau JSDoc for widget and service details, as well as examples. And also check the tutorials.

View answer in original post

4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator

When you submit your publication to ALF_CREATE_DIALOG_REQUEST, you need to include in the payload of the publication the necessary widgets to handle any "OK" or "Submit" actions, i.e. buttons which themselves send the appropriate publication that then triggers your intended action in the service registered to that publication topic. Ideally, you should never think in the callback-heavy "onXY" way, only in the message-based communication way...

npavlov
Confirmed Champ
Confirmed Champ

Thanks for the comment. And how to track the user clicking the close button in the upper right corner of the dialog?

afaust
Legendary Innovator
Legendary Innovator

Why would you want to do that? Unless the user clicks ok, why would you do anything at all?

But no worries, the DialogService supports configuration of a cancelPublishTopic which is triggered when the dialog is cancelled via the close button.

Please check the Aikau JSDoc for widget and service details, as well as examples. And also check the tutorials.

npavlov
Confirmed Champ
Confirmed Champ

Thanks for cancelPublishTopic, I thought that it only applies to the Cancel button in the dialog window. I have a data update tied to the closing of the dialog box, and not to what the user does in the dialog box.

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.