[Erp5-dev] Formulator patch that disables fields on read-only forms

Jean-Paul Smets jp at nexedi.com
Sun May 13 10:22:40 CEST 2007


Hi,

If you need to render all fields as read only, I recommend that you set all 
fields to read only.

Another approach is to create a special renderer page template (ex. 
something like form_view_read_only). But I do not recomment it because it 
is harder to maintain.

Basically, your patch is not the appropriate way because it has various 
risks.

Regarding "read only" fields, the rule is that they should be rendered as 
HTML text (never as a input widget). It is true that it makes strange 
results such as 0 and 1 for checkbox.

If you have a good idea of how to render checkboxes as text, please suggest 
it and implement it as a patch in
	Products/ERP5Form/FormulatorPatch.py  

Please not that it is probably already possible to use CSS to render 
checkboxes in a better way (ie. with an icon which depends on the content 
of the checkbox for example).

JPS.


Le vendredi 11 mai 2007, Jacek Medrzycki a écrit :
> Hi
>
> This is a small Formulator patch that disables (sets as 'not editable')
> all fields on read only form (that is, the form without the "Save"
> button). Normally, fields on read only forms are editable and users
> sometimes get confused when, after entering data, they find there is no
> way to save it.
>
> The patch is instance-wide for now. I think it should be form-specific,
> that is a form should have an entry in "Settings" tab that switches the
> functionality on or off. For now, I get Key Error on existing forms
> after adding new property to "Settings" tab.
>
> We are also thinking about modifying formulator in a way that makes it
> render not editable field as disabled HTML control, not text. Rendering
> not editable fields as text has a strange effects sometimes (eg.
> checboxes are rendered as 1 or 0).
>
> Regards
> Jacek





More information about the Erp5-dev mailing list