Closing an Alert whose content is an instance of a Form

Hello again,

I have created a Form with some components on it, and I use that as the content of an Alert, like so:

from EndScreen import EndScreen
...
def somefunction()
  myEndScreen = EndScreen()
  alert(content = myEndScreen, large=False, dismissible=True)

So, this comes up as an Alert in the app, and the user can close it by clicking off the Alert or clicking OK.

My question is, how can we close the Alert from the Alert itself? Since its content is an instance of a Form, I’d like to have one of the buttons on that Form trigger a “close this alert” event, such as when the user submits some feedback, and then return to the Form that he was previously on. I know we can close it with the Alert’s own “OK” button, but what about triggering it based on some event from the Form instance?

The docs on alerts and notifications cover that, in the section on custom popup content. Anvil Docs | Alerts and Notifications

2 Likes

I’m blind… thanks! I even remember reading that and yet I forgot it’s right there.