<br>Hi,<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Sorry my previous mail was incomplete.</blockquote><div> </div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I use the following interfaces:<br></blockquote><div><br>********************************************* <br>
</div><div>class IRecordLettree(zope.interface.Interface):<br><br></div><div> t_sub_ref = zope.schema.TextLine(<br> title=u"Sub Ref.",<br> required=True)<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
class ILettrage(zope.interface.Interface):<br> record_to_write = zope.schema.List(<br> title= u'Record to write',<br> description = u'Records written',<br> required=False,<br>
value_type = zope.schema.Object(schema=IRecordLettree)<br> )<br>******************************************<br>This interface is used in a z3c.form:<br><br>class LettrageEditForm(form.EditForm):<br> form.extends(form.EditForm)<br>
fields = field.Fields(ILettrage).select('t_record_ref', 'record_to_write')<br>
<br> def updateWidgets(self):<br> super(LettrageEditForm, self).updateWidgets()<br> self.widgets['t_record_ref'].mode = DISPLAY_MODE<br> self.widgets['record_to_write'].widgets[0].subform.widgets['t_sub_ref'].mode = DISPLAY_MODE<br>
</blockquote><div>**********************************************<br><br>When I click on the Apply button, I get the following error:<br><div class="status">
<div class="summary">There were some errors.</div>
<ul class="errors"><li>
Record to write:
<div class="error">Constraint not satisfied</div>
</li></ul>
</div>while t_sub_ref was previously filled.<br><br>The goal is to make some fields of the subobject not modifiable in the edit form (without using read-only attribute in the interface).<br><br>How could I achieve that?<br>
<br>Thanks for your help<br>Simon<br></div></div>