Bas Gooren wrote:
> To only update the attribute if the component has errors, override
> method isEnabled on the behavior, cast the component to a
> FormComponent and return !formComponent.isValid().

And remember that you must not use isValid() in onComponentTag() to
change tag attributes. You must store the validness in a transient
property in onConfigure() or onBeforeRender() and check that that
property in onComponentTag().

In fact, at least one component in 6.5.x (which we use currently in
our production system) got this wrong as well.

Some day, I'll write a post asking why that change was done between
1.4 and 6.x. If it was intentional or by accident.


Joachim Schrod, Roedermark, Germany

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to