Is there a way to know if a form has been opened in an alert?
We often have forms that are re-usable - sometimes as custom components, sometimes as routed-to stand-alone forms, and sometimes as alerts.
Is there a way to check if your form is “in” an alert?
A common example: Whether to show a “Cancel” button (and sometimes a “save” button). We’ll often pass as_alert=True
as an optional keyword argument to control that visibility but I’m wondering if there’s a way for a form to introspect whether it’s loaded in an alert?
I thought about using self.parent
but when loaded in an alert self.parent
is None
… maybe we could use that fact, but I’m never sure when self.parent
is actually set.