[Checkins] SVN: plone.z3cform/trunk/ Send an event AfterWidgetUpdateEvent after updating display widgets in a CRUD form.

Sylvain Viollon sylvain at infrae.com
Fri Oct 3 07:03:06 EDT 2008


Log message for revision 91689:
  Send an event AfterWidgetUpdateEvent after updating display widgets in a CRUD form.
  
  

Changed:
  U   plone.z3cform/trunk/docs/HISTORY.txt
  U   plone.z3cform/trunk/plone/z3cform/crud/crud.py

-=-
Modified: plone.z3cform/trunk/docs/HISTORY.txt
===================================================================
--- plone.z3cform/trunk/docs/HISTORY.txt	2008-10-03 07:55:41 UTC (rev 91688)
+++ plone.z3cform/trunk/docs/HISTORY.txt	2008-10-03 11:03:03 UTC (rev 91689)
@@ -1,6 +1,12 @@
 Changelog
 =========
 
+0.5.3 - unreleased
+------------------
+
+* Send an event IAfterWidgetUpdateEvent after updating display widgets
+  manually in a CRUD form.
+
 0.5.2 - 2008-08-28
 ------------------
 

Modified: plone.z3cform/trunk/plone/z3cform/crud/crud.py
===================================================================
--- plone.z3cform/trunk/plone/z3cform/crud/crud.py	2008-10-03 07:55:41 UTC (rev 91688)
+++ plone.z3cform/trunk/plone/z3cform/crud/crud.py	2008-10-03 11:03:03 UTC (rev 91689)
@@ -288,8 +288,10 @@
 
                 # If there were changes, we'll update the view widgets
                 # again, so that they'll actually display the changes
-                [w.update() for w in subform.widgets.values()
-                 if w.mode == DISPLAY_MODE]
+                for widget in  subform.widgets.values():
+                    if widget.mode == DISPLAY_MODE:
+                        widget.update()
+                        zope.event.notify(z3c.form.widget.AfterWidgetUpdateEvent(widget))
         self.status = status
 
     @button.buttonAndHandler(_('Delete'), name='delete')



More information about the Checkins mailing list