frontends (xmlui): cancelling form now trigger submit with {"cancelled": "true"} instead of being silently ignored

This commit is contained in:
Goffi 2016-06-29 13:51:39 +02:00
commit 25bbaa705a

View file

@ -663,6 +663,11 @@ class XMLUIPanel(XMLUIBase):
def onFormCancelled(self, ignore=None):
"""Called when a form is cancelled"""
log.debug(_("Cancelling form"))
if self.submit_id is not None:
data = {C.XMLUI_DATA_CANCELLED: C.BOOL_TRUE}
self.submit(data)
else:
log.warning(_("The form data is not sent back, the type is not managed properly"))
self._xmluiClose()
def onSaveParams(self, ignore=None):