[T5] A Question about server side validation

2008-06-19 Thread Marcelo Lotif
Hi all,

I was using a tricky field by field validation on the server side(not
cross-validation) inside the BeanEditForm and i realize that to use
onValidateFromXXX you have to declare explicitly the id of the field
wrapping it with a parameter tag. I think this is a little verbose,
since i didn't have to change anything in the field, i just have to do
it because without that, the validation do not work.

My BeanEditForm jump from a single line declaration to a long
multi-line unnecessary thing. This can be considered as a flaw?

Thanks in advance.
-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910

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



Re: [T5] A Question about server side validation

2008-06-19 Thread Thiago H. de Paula Figueiredo
Em Thu, 19 Jun 2008 10:43:49 -0300, Marcelo Lotif [EMAIL PROTECTED]  
escreveu:



I was using a tricky field by field validation on the server side(not
cross-validation) inside the BeanEditForm and i realize that to use
onValidateFromXXX you have to declare explicitly the id of the field
wrapping it with a parameter tag. I think this is a little verbose,
since i didn't have to change anything in the field, i just have to do
it because without that, the validation do not work.


Use the form validation event, not the field validation one:  
Form.VALIDATE_FORM or onValidateForm().


Thiago

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



Re: [T5] A Question about server side validation

2008-06-19 Thread Marcelo Lotif
Ok, but how can i return the error to the page with onValidateForm?
With the field validation method, i can throw a ValidationException in
case of failure, and then tapestry puts the error message on the top
of the form and decorates the bad field. But with onValidateForm i can
not do this. I tried to make a _form.recordError, but after it still
enters into the onSuccess method...

2008/6/19 Thiago H. de Paula Figueiredo [EMAIL PROTECTED]:
 Em Thu, 19 Jun 2008 10:43:49 -0300, Marcelo Lotif [EMAIL PROTECTED]
 escreveu:

 I was using a tricky field by field validation on the server side(not
 cross-validation) inside the BeanEditForm and i realize that to use
 onValidateFromXXX you have to declare explicitly the id of the field
 wrapping it with a parameter tag. I think this is a little verbose,
 since i didn't have to change anything in the field, i just have to do
 it because without that, the validation do not work.

 Use the form validation event, not the field validation one:
 Form.VALIDATE_FORM or onValidateForm().

 Thiago

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





-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910

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



Re: [T5] A Question about server side validation

2008-06-19 Thread Howard Lewis Ship
Inject the Form object and invoke the recordError() method.

On Thu, Jun 19, 2008 at 7:47 AM, Marcelo Lotif [EMAIL PROTECTED] wrote:
 Ok, but how can i return the error to the page with onValidateForm?
 With the field validation method, i can throw a ValidationException in
 case of failure, and then tapestry puts the error message on the top
 of the form and decorates the bad field. But with onValidateForm i can
 not do this. I tried to make a _form.recordError, but after it still
 enters into the onSuccess method...

 2008/6/19 Thiago H. de Paula Figueiredo [EMAIL PROTECTED]:
 Em Thu, 19 Jun 2008 10:43:49 -0300, Marcelo Lotif [EMAIL PROTECTED]
 escreveu:

 I was using a tricky field by field validation on the server side(not
 cross-validation) inside the BeanEditForm and i realize that to use
 onValidateFromXXX you have to declare explicitly the id of the field
 wrapping it with a parameter tag. I think this is a little verbose,
 since i didn't have to change anything in the field, i just have to do
 it because without that, the validation do not work.

 Use the form validation event, not the field validation one:
 Form.VALIDATE_FORM or onValidateForm().

 Thiago

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





 --
 Atenciosamente,

 Marcelo Lotif
 Programador Java e Tapestry
 FIEC - Federação das Indústrias do Estado do Ceará
 (85) 3477-5910

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





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: [T5] A Question about server side validation

2008-06-19 Thread Marcelo Lotif
Thanks for the response

But, to decorate the bad field, i still have to declare it explicitly
on the tml (of course, now i understand)
I think that would be nice if BEF resolves the field on the fly by
it's name or something, since it's intention is to write less than
usual...

Anyway, thank you for the attention! =)

2008/6/19 Howard Lewis Ship [EMAIL PROTECTED]:
 Inject the Form object and invoke the recordError() method.

 On Thu, Jun 19, 2008 at 7:47 AM, Marcelo Lotif [EMAIL PROTECTED] wrote:
 Ok, but how can i return the error to the page with onValidateForm?
 With the field validation method, i can throw a ValidationException in
 case of failure, and then tapestry puts the error message on the top
 of the form and decorates the bad field. But with onValidateForm i can
 not do this. I tried to make a _form.recordError, but after it still
 enters into the onSuccess method...

 2008/6/19 Thiago H. de Paula Figueiredo [EMAIL PROTECTED]:
 Em Thu, 19 Jun 2008 10:43:49 -0300, Marcelo Lotif [EMAIL PROTECTED]
 escreveu:

 I was using a tricky field by field validation on the server side(not
 cross-validation) inside the BeanEditForm and i realize that to use
 onValidateFromXXX you have to declare explicitly the id of the field
 wrapping it with a parameter tag. I think this is a little verbose,
 since i didn't have to change anything in the field, i just have to do
 it because without that, the validation do not work.

 Use the form validation event, not the field validation one:
 Form.VALIDATE_FORM or onValidateForm().

 Thiago

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





 --
 Atenciosamente,

 Marcelo Lotif
 Programador Java e Tapestry
 FIEC - Federação das Indústrias do Estado do Ceará
 (85) 3477-5910

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





 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

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





-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910

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