You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by marcopar <ma...@gmail.com> on 2006/05/23 17:32:48 UTC

about validation error messages

Hi, i'm following the EnjoyWebDevWithTapestry book and i'm trying to
display error messages coming from the validators. The only difference is
that i'm trying to do it without using .page files.

- First of all i want to say that i still not had understood clearly the
notation for passing parameters to the components, for example:
<form jwcid="form@Form" success="doSubmit"> IS GOOD
and
<form jwcid="form@Form" success="listener:doSubmit"> IS GOOD TOO
and
<label jwcid="@FieldLabel" field="component:name">Name</label> IS GOOD
but
<label jwcid="@FieldLabel" field="name">Name</label> IS NOT GOOD

i can't actually understand what is the correct syntax in all cases

- Now with the error messages problem:
the relevant HTML stuff is:
<form jwcid="form@Form" success="doSubmit" delegate="beans.delegate">
<input jwcid="pid@Hidden" value="ognl:pid"/>
<span jwcid="@Delegator" delegate="beans.delegate.firstError"></span>
<table border="1" cellspacing="1" cellpadding="2">
<tbody>
<tr>
<td><label jwcid="@FieldLabel" field="component:name">Name</label></td>
<td><input jwcid="name@TextField" value="ognl:glueSyringe.name"
displayName="Name" validators="validators:minLength=15[Sorbole]"/></td>
</tr>

the relevant JAVA stuff is:
@Bean
public abstract ValidationDelegate getDelegate();

on the @Form line i get the error:
Error converting value for template parameter delegate: No type converter
for type org.apache.tapestry.valid.IValidationDelegate is available.



ciao


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: about validation error messages

Posted by marcopar <ma...@gmail.com>.
that could be a problem but right now Tapestry whines at the @Form line
that is before that.
btw, isn't the % used for localized messages? I want to hard code them for
now. One step at a time :)


In data Tue, 23 May 2006 11:03:28 -0700 (PDT), Carl Pelletier ha scritto:

> A quick look at your code and I see that you missing the % before your message in the validators:
>  
> bad:
>     <input jwcid="name@TextField" value="ognl:glueSyringe.name"
> displayName="Name" validators="validators:minLength=15[Sorbole]"/>
>  
> good:
>     <input jwcid="name@TextField" value="ognl:glueSyringe.name"
> displayName="Name" validators="validators:minLength=15[%Sorbole]"/>
> 
>  
> Good luck !
>  
> Carl Pelletier
> 
> ----- Original Message ----
> From: marcopar <ma...@gmail.com>
> To: users@tapestry.apache.org
> Sent: Tuesday, May 23, 2006 11:32:48 AM
> Subject: about validation error messages
> 
> 
> Hi, i'm following the EnjoyWebDevWithTapestry book and i'm trying to
> display error messages coming from the validators. The only difference is
> that i'm trying to do it without using .page files.
> 
> - First of all i want to say that i still not had understood clearly the
> notation for passing parameters to the components, for example:
> <form jwcid="form@Form" success="doSubmit"> IS GOOD
> and
> <form jwcid="form@Form" success="listener:doSubmit"> IS GOOD TOO
> and
> <label jwcid="@FieldLabel" field="component:name">Name</label> IS GOOD
> but
> <label jwcid="@FieldLabel" field="name">Name</label> IS NOT GOOD
> 
> i can't actually understand what is the correct syntax in all cases
> 
> - Now with the error messages problem:
> the relevant HTML stuff is:
> <form jwcid="form@Form" success="doSubmit" delegate="beans.delegate">
> <input jwcid="pid@Hidden" value="ognl:pid"/>
> <span jwcid="@Delegator" delegate="beans.delegate.firstError"></span>
> <table border="1" cellspacing="1" cellpadding="2">
> <tbody>
> <tr>
> <td><label jwcid="@FieldLabel" field="component:name">Name</label></td>
> <td><input jwcid="name@TextField" value="ognl:glueSyringe.name"
> displayName="Name" validators="validators:minLength=15[Sorbole]"/></td>
> </tr>
> 
> the relevant JAVA stuff is:
> @Bean
> public abstract ValidationDelegate getDelegate();
> 
> on the @Form line i get the error:
> Error converting value for template parameter delegate: No type converter
> for type org.apache.tapestry.valid.IValidationDelegate is available.
> 
> 
> 
> ciao
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: about validation error messages

Posted by Carl Pelletier <ca...@yahoo.ca>.
A quick look at your code and I see that you missing the % before your message in the validators:
 
bad:
    <input jwcid="name@TextField" value="ognl:glueSyringe.name"
displayName="Name" validators="validators:minLength=15[Sorbole]"/>
 
good:
    <input jwcid="name@TextField" value="ognl:glueSyringe.name"
displayName="Name" validators="validators:minLength=15[%Sorbole]"/>

 
Good luck !
 
Carl Pelletier

----- Original Message ----
From: marcopar <ma...@gmail.com>
To: users@tapestry.apache.org
Sent: Tuesday, May 23, 2006 11:32:48 AM
Subject: about validation error messages


Hi, i'm following the EnjoyWebDevWithTapestry book and i'm trying to
display error messages coming from the validators. The only difference is
that i'm trying to do it without using .page files.

- First of all i want to say that i still not had understood clearly the
notation for passing parameters to the components, for example:
<form jwcid="form@Form" success="doSubmit"> IS GOOD
and
<form jwcid="form@Form" success="listener:doSubmit"> IS GOOD TOO
and
<label jwcid="@FieldLabel" field="component:name">Name</label> IS GOOD
but
<label jwcid="@FieldLabel" field="name">Name</label> IS NOT GOOD

i can't actually understand what is the correct syntax in all cases

- Now with the error messages problem:
the relevant HTML stuff is:
<form jwcid="form@Form" success="doSubmit" delegate="beans.delegate">
<input jwcid="pid@Hidden" value="ognl:pid"/>
<span jwcid="@Delegator" delegate="beans.delegate.firstError"></span>
<table border="1" cellspacing="1" cellpadding="2">
<tbody>
<tr>
<td><label jwcid="@FieldLabel" field="component:name">Name</label></td>
<td><input jwcid="name@TextField" value="ognl:glueSyringe.name"
displayName="Name" validators="validators:minLength=15[Sorbole]"/></td>
</tr>

the relevant JAVA stuff is:
@Bean
public abstract ValidationDelegate getDelegate();

on the @Form line i get the error:
Error converting value for template parameter delegate: No type converter
for type org.apache.tapestry.valid.IValidationDelegate is available.



ciao


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org