FWIW,
The following change to org/apache/turbine/services/intake/model/Field.java
fixed my problem. There is probably a better way of describing the change.
Sorry. :)
Moving the validator.assertValidity(s) call below the doSetValue(pp) call
did the trick. I hope this doesn't break anything else.
-Mitch
from:
:448 try
:449 {
:450 validator.assertValidity(s);
:451
:452 {
:453 doSetValue(pp);
:454 }
:455
:456 }
:457 catch (ValidationException ve)
:458 {
:459 setMessage(ve.getMessage());
:460 }
to:
:448 try
:449 {
:450 if ( set_flag )
:451 {
:452 doSetValue(pp);
:453 }
:454
:455 validator.assertValidity(s);
:456 }
:457 catch (ValidationException ve)
:458 {
:459 setMessage(ve.getMessage());
:460 }
-----Original Message-----
From: Rodney Schneider [mailto:rodney.schneider@;actf.com.au]
Sent: Tuesday, October 22, 2002 6:40 PM
To: Turbine Users List
Subject: Re: Using Intake to redisplay invalid form data after
validation
Hi John (and Mitch)!
Did this patch ever get committed?
http://archives.apache.org/eyebrowse/ReadMsg?listName=turbine-user@;jakarta.a
pache.org&msgNo=10231
I am pretty sure it solves the problem Mitch is describing, but I could be
wrong...
Regards,
-- Rodney
On Wed, 23 Oct 2002 11:20, you wrote:
> I think I've found the problem.
>
> During field validation, Field.validate() calls
> DefaultValidator.assertValidity() (Field:450) for the field in question,
> passing in the candidate value (from the form). Inside
> DefaultValidator.asserValidity() a test is made for value length
> (DefaultValidator:213). My value fails this test (it's too short), so the
> 'message' is set the 'minLengthMessage' (DefaultValidator:215). The a new
> ValidationException is thrown (DefaultValidator:216). This exception is
> caught by Field.validate() (Field:457). Unfortunately, this bypasses the
> (overidden) StringField.doSetValue(pp) call on line 454. As such,
> setTestValue() never gets called, and Field.testValue never get set,
> resulting in no value being displayed back in your form.
>
> Now, the question is, what do I do about this? I suppos that I could not
> use the IntakeService, but I would *really* like to. An obvious
> alternative would be to fix/patch locally. I'm not sure how much time
that
> would take, I've never compiled Turbine before.
>
> Any other suggestions?
>
> -Mitch
>
> PS It would be nice if someone would be kind enough to validate/invalidate
> my findings in case I'm totally wrong on this one.
--
To unsubscribe, e-mail:
<mailto:turbine-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:turbine-user-help@;jakarta.apache.org>
--
To unsubscribe, e-mail: <mailto:turbine-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-user-help@;jakarta.apache.org>