Geert,

When a property is constrained with editable to false, it is not shown. But there are cases where it is needed to see such data even if it must not be changed.

May I suggest a new constrain "visible" that will be false by default if editable is false.


That constraint might be handy, but I wonder if another name wouldn't be better since properties are visible by default.

I took a name that imo is unambiguous. But it's just a proposition.

About default behavior, true by default. It seems to me that it's like with editable constraint: when no such constraint is specified, then a property is editable. It's only really needed when a property must not be editable.

However, I don't agree with your implementation for EditTemplateTransformer in RIFE/ Crud, the editable and visible semantics aren't the same. If a property is editable, the form field should be shown, if it's not editable but visible, the current value of the field should be shown and not the form field.

If  I understand rightly the semantic above:
- if editable at true (or unspecified): field is always shown , even if visible is at false - if editable at false: field is visible only if visible is specified at true (and then visible is false by default?)

My proposition was:
- if no visible constrain then see editable behavior (i.e. the actual behavior) - if visible at true: field is always shown and then it's possible to change the value only if editable is true or unspecified
- if visible at false: field is not shown even if editable

and then the isVisible test in place of the isEditable one in EditTemplateTransformer is coherent with this.

The only difference between the two semantics is editable at true (or unspecified) and visible at false:
- first one: field is shown
- second one: field is not shown

To set explicitly visble to false and editabled to true has no much meaning. But as soon as visible is at false, imo no fieldis expected to be shown, whatever editable value. And especialy if no editable constraint is specified. The rule is: visible > editable.

This need to replace the editable test in Edit/Add/ DeleteTemplateTransformer.java of Rife-crud.

A step further: when a value is non editable, to be able to give a first value, automatically or manually.


I can't find a trace of this.

This is done in:
- Submission: a property is added to the parameter lists as soon as it is visible, even if not editable - ElementContext: as soon as a parameter not editable is without error, then it is removed from the Submission list.

Could you also explain why you made changes related to the error reporting in FormBuilderXhtml?

In the "manuelly" case, where a field is not editable but you want that a user enters the initial value, if there are other constraints, then as far as this initial value doesn't respect these constraint, the erroneous value must be shown to the user to be changed. So the "input" tag must not be desabled.

Regards

Pierre


_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users

Reply via email to