Modal dialog 'cancel' button cannot be disabled using AP.dialog.getButton('cancel').disable()

Hi there,

We make use of a modal dialog to submit some information to our apps that involve copying and creating spaces and page trees.

And as such we would like to disable some buttons during the processing step.

According to the JavaScript API, users can make use of AP.dialog.getButton() to access various buttons on the page. This works fine for the submit buttona and cancel button as can be seen below:


However when I attempt to make use of AP.dialog.getButton().disable(), it only works for the submit button and not the cancel button:


The above code only disables the submit button and not the cancel button:


Has anyone else managed to successfully disable the cancel button?

Kind regards,
Dirk de Klerk
EPS software Engineer

If it turns out that you can’t disable the cancel button (I don’t know whether you can or not!), I would assume it’s because we want to leave the user with a way of closing the dialog.

Why do you want to prevent the user from closing the dialog the expected way?

DoesAP.dialog.getButton('cancel').toggle() do anything?

Can’t speak to’s needs but we’re looking into something similar since we’re needing the dialog component to be shown while we’re fetching data. We’ve got a workaround but hiding the button like we can do cancel would be nice.

Hi @dmorrow,

I have attempted to use toggle as well? with no effect?

Kind regards,

Hi @huw,

Agree that there needs to be an expected way to close a dialog. However we do perform sensitive operations during the submit phase so would like to disable the cancel button for that period of time.

The snippet above infers that I can get the cancel button using getButton(). If I cannot call any functions on the returned object, it feels a bit redundant.

Perhaps the documentation can be updated to reflect that fact then?

KInd regards,


Hi and @danielwester, if you take a look at ACJS-253, it seems the prevention of the disabling of the cancel button was deliberate, but there is no documented reason. I’ve added a comment to see if we can understand why.


@mstaas posted a workaround in ACJS-253 whereby you create a chromeless dialog so that the dialog doesn’t include the cancel button.

  "size": "medium",
  "chrome": false,
  "header": "header"
1 Like

Hi @dmorrow, Thank you for providing me with feedback as well as an alternative solution. It is really appreciated.

Really excellent support from your side.

Kind regards,


1 Like