web/views/editforms.py
changeset 4310 a139b98b6af5
parent 4278 24736a127bf1
child 4365 e2d26ff8f13b
--- a/web/views/editforms.py	Thu Jan 21 10:52:47 2010 +0100
+++ b/web/views/editforms.py	Thu Jan 21 10:57:20 2010 +0100
@@ -440,7 +440,14 @@
         form = self._cw.vreg['forms'].select(self.__regid__, self._cw,
                                              rset=self.cw_rset,
                                              copy_nav_params=True)
-        self.w(form.render())
+        # XXX overriding formvid (eg __form_id) necessary to make work edition:
+        # the edit controller try to select the form with no rset but
+        # entity=entity, and use this form to edit the entity. So we want
+        # edition form there but specifying formvid may have other undesired
+        # side effect. Maybe we should provide another variable optinally
+        # telling which form the edit controller should select (eg difffers
+        # between html generation / post handling form)
+        self.w(form.render(formvid='edition'))
 
 
 class InlineEntityEditionFormView(FormViewMixIn, EntityView):