hidden input fields : compute displayability using the associated visible field tls-sprint
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 30 Apr 2009 12:57:23 +0200
branchtls-sprint
changeset 1601 171afa270086
parent 1579 4eea314694e2
child 1602 3cca95459779
hidden input fields : compute displayability using the associated visible field
web/formrenderers.py
--- a/web/formrenderers.py	Thu Apr 30 12:36:48 2009 +0200
+++ b/web/formrenderers.py	Thu Apr 30 12:57:23 2009 +0200
@@ -15,6 +15,7 @@
 from cubicweb.web import eid_param
 from cubicweb.web import formwidgets as fwdgs
 from cubicweb.web.widgets import checkbox
+from cubicweb.web.formfields import HiddenInitialValueField
 
 
 class FormRenderer(object):
@@ -145,6 +146,8 @@
         return tag + '>'
 
     def display_field(self, form, field):
+        if isinstance(field, HiddenInitialValueField):
+            field = field.visible_field
         return (self.display_fields is None
                 or (field.name, field.role) in self.display_fields
                 or (field.name, field.role) in form.internal_fields)