A problem with migration from DialogButton.bind() method

Hi, DialogButton.bind() (AP.dialog.getDialogButton().bind()) is deprecated now, but I can’t replace it with suggested Events.on() method. I use it to override default Macro Editor dialog - I do custom validation, and I need to prevent the default submit event. With the new API, I can’t do that.

Thank in advance.

2 Likes

Amen. I had the same problem. In the end, I set all of my dialogs to chrome: false, and created my own buttons. I don’t think there’s a pretty answer to this right now. Best we can do is signal to the Atlassian developers that there’s a bit of discomfort.

2 Likes

The correct way to do this is: AP.dialog.getButton(‘submit’).disable();

The thing is, in some cases you don’t want to disable the button, you just want the opportunity to intercept the clicking of the Submit button and have your own code determine whether the form should be submitted.

2 Likes

We are also missing this feature. Disabling the button is not an option. It is pretty usual pattern to validate on submit.

@cwhittington Yea, we are having an issue with the migration as well as we are trying to save the macro on submitting the dialog but the SaveMacro function isn’t working correctly for us
We are trying to do the same thing that is on this doc page: https://developer.atlassian.com/static/connect/docs/latest/modules/fragment/macro-editor.html but of course in updating we would like to not use the DialogButton.bind()

@david.pinn you’re totally right.
I’ve spoken to the team about this and it’s something that was missing from our plan.
For now, i’d stick with button.bind. I have made an issue to track this here: https://ecosystem.atlassian.net/browse/ACJS-655
Before button.bind is deprecated we will have implemented a solution for this.

@josh.galea i have also mentioned the confluence macro issue as part of this.

1 Like