Re: ValidateForm Event

2009-09-01 Thread Benny Law
That looks very reasonable. I think I will adopt this approach. Thanks Geoff. Benny On Wed, Sep 2, 2009 at 1:02 AM, Geoff Callender < geoff.callender.jumpst...@gmail.com> wrote: > Yes, let's hope the doco is updated soon! > >https://issues.apache.org/jira/browse/TAP5-812 > > As for your

Re: ValidateForm Event

2009-09-01 Thread Geoff Callender
Yes, let's hope the doco is updated soon! https://issues.apache.org/jira/browse/TAP5-812 As for your conundrum, is there a reason you're not happy to do the following? It's only a few lines and its intention seems very clear. @Component(id = "searchForm") private Form

Re: ValidateForm Event

2009-09-01 Thread Benny Law
Thanks for alerting me, Geoff. But even the input validation example in the User Guide shows recording error in onSuccess()! I must say I'm a bit alarmed by these "quirks". I hope I don't find too many more surprises when I get deeper into Tapestry 5.1. I am working on a critical application under

Re: ValidateForm Event

2009-09-01 Thread Geoff Callender
Beware, there's a long-standing problem with recording errors in onSuccess(). https://issues.apache.org/jira/browse/TAPESTRY-1972 Geoff On 02/09/2009, at 7:59 AM, Benny Law wrote: Thanks Sebastian. I agree that only business logic related validation should go into onSuccess, and I

Re: ValidateForm Event

2009-09-01 Thread Benny Law
Thanks Sebastian. I agree that only business logic related validation should go into onSuccess, and I would leave basic field validations to validators as much as possible. My problem with onValidateForm is still the amount of code I need to write to check for existing errors before I can do cross

Re: ValidateForm Event

2009-09-01 Thread Sebastian Hennebrueder
Hello, the intended validation method for cross field validation is onValidateForm The onSuccess is probable the latest point to do validation. I would only place business logic related validation in there You may do field validation in the onValidateForm as well but it is normally simpler, f

Re: ValidateForm Event

2009-08-31 Thread newtonik
Hi, To keep all your validation in onValidateForm, I something like this. String onValidateForm() { if(userName == null ) { form.recordError(usernameField, "Needs a Username") } if(password == null ) { form.recordError(passwordField, "Please Enter a pas

Re: ValidateForm Event

2009-08-31 Thread Benny Law
Hi Onno, I am all for clean and maintainable code, and that's why I think ValidateForm can be cleaner if I didn't need to check for field errors first. On the main Tapestry 5.1 page, the Login example calls the authenticator in onValidateForm, but the same example in the User Guide under Input Va

Re: ValidateForm Event

2009-08-31 Thread Onno Scheffers
> Thanks for your response. Could you explain what you mean by keeping my > validation "in the correct callback"? I think it's about writing clean and maintainable code. For other developers reading back your code it makes more sense if you add your validation errors in the ValidateForm event an

Re: ValidateForm Event

2009-08-30 Thread Benny Law
Thanks for your response. Could you explain what you mean by keeping my validation "in the correct callback"? Benny Law On Sun, Aug 30, 2009 at 1:40 AM, newtonik wrote: > > I think you should use the onValidateForm for both field level and > cross-field validation to keep your validation in the

Re: ValidateForm Event

2009-08-29 Thread newtonik
I think you should use the onValidateForm for both field level and cross-field validation to keep your validation in the correct callback. I would just use nested loops to first check for field level validation then if successful, perform cross field validation. Benny Law wrote: > > Hello, >