How to do someting onClose of Dialog in aikau?

cancel
Showing results for 
Search instead for 
Did you mean: 
npavlov
Active Member II

How to do someting onClose of Dialog in aikau?

Jump to solution

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 Solution

Accepted Solutions
afaust
Master

Re: How to do someting onClose of Dialog in aikau?

Jump to solution

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 solution in original post

4 Replies
afaust
Master

Re: How to do someting onClose of Dialog in aikau?

Jump to solution

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
Active Member II

Re: How to do someting onClose of Dialog in aikau?

Jump to solution

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

afaust
Master

Re: How to do someting onClose of Dialog in aikau?

Jump to solution

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
Active Member II

Re: How to do someting onClose of Dialog in aikau?

Jump to solution

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.