Ben is right. Currently, values are bound only if translation succeeds (this is essential), but before validation happens. This was done purposefully to support "Save" style logic, since validation errors can optionally be ignored in the triggered form listener by ignoring the value of IValidationDelegate.getHasErrors(). I put this logic in place before the veto logic was implemented (I think - although I work probably overlapped). This is easy enough to change. In 3.0, ValidField values could only be bound if and only if validation succeeded since the old IValidators were responsible for both translation and validation. Since this limitation no longer exists, we have the option of binding value either before or after the validators run.

What are the advantages/disadvantages to each approach?

Paul

Howard Lewis Ship wrote:

Validation does not work that way, not to my knowledge.  Even with the
new validation, the translator and validators all have veto power, by
throwing ValidationException, before an update occurs to the bound
property.

TAPESTRY-369 was a suggestion that was since judged invalid. It is not
how Tapestry operates.

On 8/23/05, Ben Pryor <[EMAIL PROTECTED]> wrote:
Hi,

I'm upgrading a large Tapestry 3 application to Tapestry 4.  One
unexpected behavior is that the new validation system appears to always
update a form component's bound property before doing validation and
recording any errors. There is a JIRA issue from July that mentions this
behavior (http://issues.apache.org/jira/browse/TAPESTRY-369). The
problem is that almost everywhere in our application     we expect the
bound property to only be updated if validation succeeds.

How do others handle this situation with the new validation? Should the
validation system be flexible enough to allow for sometimes updating the
bound property when in error and sometimes not?

Thanks,
Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to