Michiel Meeuwissen wrote:
Ernst Bunders wrote:

  small question: if you never enforce the pattern, then why define it at
  all?


It means that it is never enforced by MMBase then, so it will not cause
an error if the input fails to obey it. You can still request the
pattern and use it e.g. to decide whether the input form entry must
become a textarea or not, or to generate validating javascript with it
or so.

E.g. the taglib's 'mm:fieldinfo' now checks if the pattern allows a newline,
and if so, it generates a textarea, and otherwise a normal one-line
input box.

There is also 'enforce="oncreate"', in which case mmbase will only throw
errors if new input is invalid. enforce="onchange" will only enforce if
a field value is changed. This can be used for backwards compatibility,
but also for datatypes for wich the validity of values can change in
time (like datetime values with a minummum value relative to the current
time).

I really don't like it, but if we really have to keep it to be backwards compatible for editors then I am fine with enforce="never".

New Question

How would a specialization for creationdate look like? Something like this with a setprocessor throwing an Exception?

    <specialization id="created">
      <default value="now" />
      <setprocessor>
        <class name="org.mmbase.datatypes.processors.Readonly" />
      </setprocessor>
    </specialization>

Nico
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to