--- a/web/views/cwproperties.py Fri May 29 14:07:42 2009 +0200
+++ b/web/views/cwproperties.py Fri May 29 14:19:30 2009 +0200
@@ -17,7 +17,7 @@
match_user_groups)
from cubicweb.view import StartupView
from cubicweb.web import uicfg, stdmsgs
-from cubicweb.web.form import CompositeForm, EntityFieldsForm, FormViewMixIn
+from cubicweb.web.form import FormViewMixIn
from cubicweb.web.formfields import FIELDS, StringField
from cubicweb.web.formwidgets import Select, Button, SubmitButton
from cubicweb.web.views import primary, formrenderers
@@ -189,10 +189,11 @@
def form(self, formid, keys, splitlabel=False):
buttons = [SubmitButton()]
- form = CompositeForm(self.req, domid=formid, action=self.build_url(),
- form_buttons=buttons,
- onsubmit="return validatePrefsForm('%s')" % formid,
- submitmsg=self.req._('changes applied'))
+ form = self.vreg.select_object('forms', 'composite', self.req,
+ domid=formid, action=self.build_url(),
+ form_buttons=buttons,
+ onsubmit="return validatePrefsForm('%s')" % formid,
+ submitmsg=self.req._('changes applied'))
path = self.req.relative_path()
if '?' in path:
path, params = path.split('?', 1)
@@ -200,7 +201,8 @@
form.form_add_hidden('__redirectpath', path)
for key in keys:
self.form_row(form, key, splitlabel)
- renderer = CWPropertiesFormRenderer(self.req, display_progress_div=False)
+ renderer = self.vreg.select_object('formrenderers', 'cwproperties', self.req,
+ display_progress_div=False)
return form.form_render(renderer=renderer)
def form_row(self, form, key, splitlabel):
@@ -209,8 +211,8 @@
label = key.split('.')[-1]
else:
label = key
- subform = EntityFieldsForm(self.req, entity=entity, set_error_url=False)
-
+ subform = self.vreg.select_object('forms', 'base', self.req, entity=entity,
+ set_error_url=False)
subform.append_field(PropertyValueField(name='value', label=label,
eidparam=True))
subform.vreg = self.vreg