[Checkins] SVN: z3c.form/trunk/src/z3c/form/button.py We want
events for button actions as well. After all, they are just
Stephen Richter
cvs-admin at zope.org
Sat Jul 7 01:45:10 EDT 2007
Log message for revision 77555:
We want events for button actions as well. After all, they are just
widgets.
Changed:
U z3c.form/trunk/src/z3c/form/button.py
-=-
Modified: z3c.form/trunk/src/z3c/form/button.py
===================================================================
--- z3c.form/trunk/src/z3c/form/button.py 2007-07-07 05:29:46 UTC (rev 77554)
+++ z3c.form/trunk/src/z3c/form/button.py 2007-07-07 05:45:10 UTC (rev 77555)
@@ -17,6 +17,7 @@
"""
__docformat__ = "reStructuredText"
import sys
+import zope.event
import zope.interface
import zope.location
import zope.schema
@@ -25,6 +26,7 @@
from zope.schema.fieldproperty import FieldProperty
from z3c.form import action, interfaces, util, value
from z3c.form.browser import submit
+from z3c.form.widget import AfterWidgetUpdateEvent
StaticButtonActionAttribute = value.StaticValueCreator(
@@ -117,8 +119,6 @@
def getHandler(self, button):
"""See interfaces.IButtonHandlers"""
buttonProvided = zope.interface.providedBy(button)
- #if button.__class__.__name__ == 'SpecialButton':
- # import pdb; pdb.set_trace()
return self._registry.lookup1(buttonProvided, interfaces.IButtonHandler)
def copy(self):
@@ -242,6 +242,7 @@
zope.interface.alsoProvides(buttonAction, interfaces.IFormAware)
# Step 6: Update the new action
buttonAction.update()
+ zope.event.notify(AfterWidgetUpdateEvent(buttonAction))
# Step 7: Add the widget to the manager
self._data_keys.append(name)
self._data_values.append(buttonAction)
More information about the Checkins
mailing list