You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jun Tsai <ju...@gmail.com> on 2005/09/07 07:26:22 UTC
How to write a customer validator?
hi,all.
Now I can validate userName@TextField using validators.It can display the
error message .But my system need to check the user who have exist in
database,how to display the message to the userName@TextField component.
Thanks
Jun Tsai
--
Welcome to China Java Users Group(CNJUG).
http://cnjug.dev.java.net
Re: How to write a customer validator?
Posted by Tomáš Drenčák <to...@gmail.com>.
Probably you use ValidationDelegate. So in listener method you can
access that ValidationDelegate and set invalid field with
setFormComponent, I guess, and write an error with record(String,
null)
2005/9/7, Ron Piterman <rp...@gmx.net>:
> Look at the wiki -> tapestry 4 -> Howtos
>
>
> ציטוט Jun Tsai:
> > hi,all.
> > Now I can validate userName@TextField using validators.It can display the
> > error message .But my system need to check the user who have exist in
> > database,how to display the message to the userName@TextField component.
> > Thanks
> > Jun Tsai
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
Re[2]: How to write a customer validator?
Posted by Alexandr Kundirenko <ak...@gmail.com>.
You can inject spring bean into page and access page from validator:
public void validate(IFormComponent field, ValidationMessages messages, Object object) throws ValidatorException {
IPage page = field.getPage();
...
}
JT> Thank your reply.
JT> But How to inject spring bean in CustomValidator? I have inject spring bean
JT> from a page using @InjectObject("spring:xx").
JT> Jun Tsai.
JT> On 9/7/05, Ron Piterman <rp...@gmx.net> wrote:
>>
>> Look at the wiki -> tapestry 4 -> Howtos
>>
>>
>> ????? Jun Tsai:
>> > hi,all.
>> > Now I can validate userName@TextField using validators.It can display
>> the
>> > error message .But my system need to check the user who have exist in
>> > database,how to display the message to the userName@TextField component.
>> > Thanks
>> > Jun Tsai
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>
>>
--
aku
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to write a customer validator?
Posted by Jun Tsai <ju...@gmail.com>.
Thank your reply.
But How to inject spring bean in CustomValidator? I have inject spring bean
from a page using @InjectObject("spring:xx").
Jun Tsai.
On 9/7/05, Ron Piterman <rp...@gmx.net> wrote:
>
> Look at the wiki -> tapestry 4 -> Howtos
>
>
> ציטוט Jun Tsai:
> > hi,all.
> > Now I can validate userName@TextField using validators.It can display
> the
> > error message .But my system need to check the user who have exist in
> > database,how to display the message to the userName@TextField component.
> > Thanks
> > Jun Tsai
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
Welcome to China Java Users Group(CNJUG).
http://cnjug.dev.java.net
Re: How to write a customer validator?
Posted by Ron Piterman <rp...@gmx.net>.
Look at the wiki -> tapestry 4 -> Howtos
ציטוט Jun Tsai:
> hi,all.
> Now I can validate userName@TextField using validators.It can display the
> error message .But my system need to check the user who have exist in
> database,how to display the message to the userName@TextField component.
> Thanks
> Jun Tsai
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org