Added "warnOnChange" property to handle warnings on form change
authorThierry Florac <thierry.florac@onf.fr>
Tue, 23 Sep 2014 17:16:50 +0200
changeset 65 215f42f84617
parent 64 4c65a74656e4
child 66 4bdf3012c591
Added "warnOnChange" property to handle warnings on form change
src/ztfy/myams/form.py
--- a/src/ztfy/myams/form.py	Mon Sep 15 13:06:41 2014 +0200
+++ b/src/ztfy/myams/form.py	Tue Sep 23 17:16:50 2014 +0200
@@ -204,6 +204,7 @@
 
     autocomplete = 'on'
     display_hints_on_widgets = True
+    warn_on_change = u'default'
     handle_upload = False
 
     subforms_legend = None
@@ -224,6 +225,15 @@
         [subform.update() for subform in self.subforms]
         [tabform.update() for tabform in self.tabforms]
 
+    @property
+    def warnOnChange(self):
+        if self.warn_on_change is True:
+            return u'true'
+        elif self.warn_on_change is False:
+            return u'false'
+        else:
+            return None
+
     def isDialog(self):
         return IDialog.providedBy(self)