web/views/basecontrollers.py
branchtls-sprint
changeset 1314 dc5499bff1a9
parent 1309 a4eb20f86cb0
child 1320 c85f4d8eff8b
--- a/web/views/basecontrollers.py	Thu Apr 09 12:37:00 2009 +0200
+++ b/web/views/basecontrollers.py	Thu Apr 09 12:40:30 2009 +0200
@@ -388,15 +388,17 @@
 
     def js_prop_widget(self, propkey, varname, tabindex=None):
         """specific method for EProperty handling"""
+        print 'PROP WIDGET', propkey, varname, tabindex
         entity = self.vreg.etype_class('EProperty')(self.req, None, None)
         entity.eid = varname
         entity['pkey'] = propkey
-        entity['value'] = self.vreg.property_info(propkey)['default']
-        form = self.vreg.select_object('forms', 'edition', entity=entity)
+        form = self.vreg.select_object('forms', 'edition', self.req, None,
+                                       entity=entity)
+        form.form_build_context()
         vfield = form.field_by_name('value')
         renderer = FormRenderer()
-        return (vfield.render(form, renderer, tabindex=tabindex)
-                + renderer.render_help(form, vfield))
+        return vfield.render(form, renderer, tabindex=tabindex) \
+                   + renderer.render_help(form, vfield)
 
     def js_component(self, compid, rql, registry='components', extraargs=None):
         if rql: