Author: reinhard
Date: 2006-11-07 11:17:55 -0600 (Tue, 07 Nov 2006)
New Revision: 8985

Modified:
   trunk/gnue-forms/src/input/displayHandlers/Cursor.py
Log:
Make sure the entry is not in editing mode while the value of the field is set,
so that at the time the autoquery runs, the entry is not editing.


Modified: trunk/gnue-forms/src/input/displayHandlers/Cursor.py
===================================================================
--- trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-11-07 
16:50:05 UTC (rev 8984)
+++ trunk/gnue-forms/src/input/displayHandlers/Cursor.py        2006-11-07 
17:17:55 UTC (rev 8985)
@@ -221,6 +221,11 @@
     if not self.editing:
       return
 
+    # Set editing to False early. The later call to __updateFieldValue() can,
+    # if it is an autoquery field, cause a query to run, in which case editing
+    # should not be True at that moment.
+    self.editing = False
+
     if not self._loadedAllowedValues:
       self.field.allowedValues()
       self._loadedAllowedValues = True
@@ -228,14 +233,13 @@
     self._selection1 = None
 
     if self.modified:
-      self.__updateFieldValue()
-      self.editing = False
-      self._buildDisplay()
+      try:
+        self.__updateFieldValue()
+        self._buildDisplay()
+      except:
+        self.editing = True
 
-    else:
-      self.editing = False
 
-
   def _addText(self, event):
     """
     Handles the adding of new text 



_______________________________________________
commit-gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/commit-gnue

Reply via email to