[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r5623 - trunk/gnue-forms/src
From: |
jamest |
Subject: |
r5623 - trunk/gnue-forms/src |
Date: |
Fri, 2 Apr 2004 16:04:01 -0600 (CST) |
Author: jamest
Date: 2004-04-02 16:04:00 -0600 (Fri, 02 Apr 2004)
New Revision: 5623
Modified:
trunk/gnue-forms/src/GFForm.py
trunk/gnue-forms/src/GFInstance.py
Log:
pre-exit trigger can now abort form exit
Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py 2004-04-02 21:58:10 UTC (rev 5622)
+++ trunk/gnue-forms/src/GFForm.py 2004-04-02 22:04:00 UTC (rev 5623)
@@ -37,7 +37,7 @@
from gnue.common import events
from gnue.common.datasources.GDataObjects import ConnectionError as DBError
from gnue.common.definitions.GRootObj import GRootObj
-from gnue.common.logic.GTrigger import TriggerError
+from gnue.common.logic.language import AbortRequest
from gnue.common.definitions.GObjects import GObj
from gnue.common.datasources import ConnectionTriggerObj
from gnue.forms.GFObjects import *
@@ -331,20 +331,20 @@
if fireFocusTriggers:
try:
if fieldChange:
- self._currentEntry.processTrigger('Pre-FocusOut')
+ self._currentEntry.processTrigger('Pre-FocusOut',
ignoreAbort=False)
if hasattr(self._currentEntry,'_field'):
- self._currentEntry._field.processTrigger('Pre-FocusOut')
+ self._currentEntry._field.processTrigger('Pre-FocusOut',
ignoreAbort=False)
if blockChange:
- self._currentBlock.processTrigger('Pre-FocusOut')
+ self._currentBlock.processTrigger('Pre-FocusOut',
ignoreAbort=False)
if pageChange:
- self._currentPage.processTrigger('Pre-FocusOut')
- self._currentPage.processTrigger('Post-FocusOut')
+ self._currentPage.processTrigger('Pre-FocusOut', ignoreAbort=False)
+ self._currentPage.processTrigger('Post-FocusOut',
ignoreAbort=False)
if blockChange:
- self._currentBlock.processTrigger('Post-FocusOut')
+ self._currentBlock.processTrigger('Post-FocusOut',
ignoreAbort=False)
if fieldChange:
- self._currentEntry.processTrigger('Post-FocusOut')
+ self._currentEntry.processTrigger('Post-FocusOut',
ignoreAbort=False)
if hasattr(self._currentEntry,'_field'):
- self._currentEntry._field.processTrigger('Post-FocusOut')
+ self._currentEntry._field.processTrigger('Post-FocusOut',
ignoreAbort=False)
except AttributeError:
pass
@@ -368,24 +368,24 @@
if fireFocusTriggers:
if pageChange:
- self._currentPage.processTrigger('Pre-FocusIn')
+ self._currentPage.processTrigger('Pre-FocusIn', ignoreAbort=False)
if blockChange:
- self._currentBlock.processTrigger('Pre-FocusIn')
+ self._currentBlock.processTrigger('Pre-FocusIn', ignoreAbort=False)
if fieldChange:
- self._currentEntry.processTrigger('Pre-FocusIn')
+ self._currentEntry.processTrigger('Pre-FocusIn', ignoreAbort=False)
if hasattr(self._currentEntry,'_field'):
- self._currentEntry._field.processTrigger('Pre-FocusIn')
+ self._currentEntry._field.processTrigger('Pre-FocusIn',
ignoreAbort=False)
if hasattr(self._currentEntry,'_field'):
- self._currentEntry._field.processTrigger('Post-FocusIn')
- self._currentEntry.processTrigger('Post-FocusIn')
+ self._currentEntry._field.processTrigger('Post-FocusIn',
ignoreAbort=False)
+ self._currentEntry.processTrigger('Post-FocusIn', ignoreAbort=False)
if blockChange:
- self._currentBlock.processTrigger('Post-FocusIn')
+ self._currentBlock.processTrigger('Post-FocusIn', ignoreAbort=False)
if pageChange:
- self._currentPage.processTrigger('Post-FocusIn')
+ self._currentPage.processTrigger('Post-FocusIn', ignoreAbort=False)
self.refreshUIEvents()
- except TriggerError, t:
+ except AbortRequest, t:
GDebug.printMesg(1, "Trigger Error!")
message = _("Trigger Exception :\n") + t.msg
return message
@@ -507,9 +507,9 @@
if not self.readonly:
# Form level pre-commit
try:
- self.processTrigger('Pre-Commit')
- except TriggerError:
- GDebug.printMesg(1, "Trigger form Pre-Commit threw a TriggerError!")
+ self.processTrigger('Pre-Commit', ignoreAbort=False)
+ except AbortRequest:
+ GDebug.printMesg(1, "Trigger form Pre-Commit threw a AbortRequest!")
self.dispatchEvent('endWAIT',None, _form=self)
#self._instance.dispatchEvent('endWAIT',None, _form=self)
return _("Form trigger returned error")
@@ -522,8 +522,8 @@
block._precommitRecord = block._currentRecord
block.processCommit()
- except TriggerError:
- GDebug.printMesg(1, "Trigger block Pre-Commit threw a
TriggerError!")
+ except AbortRequest:
+ GDebug.printMesg(1, "Trigger block Pre-Commit threw a
AbortRequest!")
self.dispatchEvent('endWAIT',None, _form=self)
#self._instance.dispatchEvent('endWAIT',None, _form=self)
return _("Block trigger returned error")
Modified: trunk/gnue-forms/src/GFInstance.py
===================================================================
--- trunk/gnue-forms/src/GFInstance.py 2004-04-02 21:58:10 UTC (rev 5622)
+++ trunk/gnue-forms/src/GFInstance.py 2004-04-02 22:04:00 UTC (rev 5623)
@@ -45,7 +45,7 @@
from gnue.common import events
from gnue.common.utils.FileUtils import dyn_import
from gnue.common.utils.FileUtils import openResource, openBuffer
-
+from gnue.common.logic.language import AbortRequest
from gnue.common.apps.GClientApp import *
class GFInstance(events.EventAware):
@@ -735,7 +735,7 @@
#
def executeExit(self, event):
try:
- event._form.processTrigger('Pre-Exit')
+ event._form.processTrigger('Pre-Exit', ignoreAbort=False)
if not event._form.isSaved():
self.displayMessageBox( _('Data not saved. Save changes or clear the
form to proceed.'))
@@ -743,8 +743,8 @@
else:
event._form.processTrigger('On-Exit')
self.dispatchEvent('exitApplication',_('Current data is
saved'),_formName=event._form.name)
- except TriggerError, t:
- self.displayMessageBox(t.msg)
+ except AbortRequest, t:
+ self.displayMessageBox(t)
event._form.refreshUIEvents()
#
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r5623 - trunk/gnue-forms/src,
jamest <=