You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by James Sherwood <js...@rgisolutions.com> on 2009/02/02 16:25:27 UTC

T5: Validation and message catalogue

Hello,

 

I cannot seem to get a textfield validate message to work using regexp and
message catalogs.

 

I use Tomcat/Eclipse.

 

This is my .tml:

<td><b>Cell Phone:</b></td>

<td><t:textfield id="cellPhone" value="cellPhone"/></td> 

 

This is my java:

@Validate("regexp")

public String getCellPhone(){

return getVisit().getNstuMember().getCellphone();

}

public void setCellPhone(String cellPhone){
getVisit().getNstuMember().setCellphone(cellPhone);

}

 

This is my message catalogue:

cellPhone-regexp=\d{3}-\d{2}-\d{4}

cellPhone-regexp-message=Invalid Number EX: (555) 555-5555,5555555555

 

I have tried placing it(Main.properties) everywhere and tapestry always
throws this error:

Render queue error in BeginRender[Main:textfield_7]: Failure reading
parameter 'validate' of component Main:textfield_7: Validator 'regexp'
requires a validation constraint (of type java.util.regex.Pattern) but none
was provided. The constraint may be provided inside the @Validator annotaton
on the property, or in the associated component message catalogue as key
'personalForm-textfield_7-regexp' or key 'textfield_7-regexp'. 

 

In the docs it says to use this format:

<t:textfield t:id="ssn" validate="required,regexp"/>

And your message catalogue can contain:

 

ssn-regexp=\d{3}-\d{2}-\d{4}

ssn-regexp-message=Social security numbers are in the format 12-34-5678.

 

What am I missing?

 

Thanks,

--James

 

 


RE: T5: Validation and message catalogue

Posted by James Sherwood <js...@rgisolutions.com>.
Hello,

NVM I am an idiot.  I was forgetting the t: for the id..:(

Thanks,
--James

-----Original Message-----
From: James Sherwood [mailto:jsherwood@rgisolutions.com] 
Sent: February-02-09 11:58 AM
To: 'Tapestry users'
Subject: RE: T5: Validation and message catalogue

Hello,

It is not a matter of the text used in the validate(I actually did try it
though), it is a matter of tapestry either a: not finding the file or b: I
am implementing it wrong

--James

-----Original Message-----
From: Sven Homburg [mailto:homburgs@googlemail.com] 
Sent: February-02-09 11:33 AM
To: Tapestry users
Subject: Re: T5: Validation and message catalogue

try double slashed like this

ssn-regexp=\\d{3}-\\d{2}-\\d{4}

2009/2/2 James Sherwood <js...@rgisolutions.com>

> Hello,
>
>
>
> I cannot seem to get a textfield validate message to work using regexp and
> message catalogs.
>
>
>
> I use Tomcat/Eclipse.
>
>
>
> This is my .tml:
>
> <td><b>Cell Phone:</b></td>
>
> <td><t:textfield id="cellPhone" value="cellPhone"/></td>
>
>
>
> This is my java:
>
> @Validate("regexp")
>
> public String getCellPhone(){
>
> return getVisit().getNstuMember().getCellphone();
>
> }
>
> public void setCellPhone(String cellPhone){
> getVisit().getNstuMember().setCellphone(cellPhone);
>
> }
>
>
>
> This is my message catalogue:
>
> cellPhone-regexp=\d{3}-\d{2}-\d{4}
>
> cellPhone-regexp-message=Invalid Number EX: (555) 555-5555,5555555555
>
>
>
> I have tried placing it(Main.properties) everywhere and tapestry always
> throws this error:
>
> Render queue error in BeginRender[Main:textfield_7]: Failure reading
> parameter 'validate' of component Main:textfield_7: Validator 'regexp'
> requires a validation constraint (of type java.util.regex.Pattern) but
none
> was provided. The constraint may be provided inside the @Validator
> annotaton
> on the property, or in the associated component message catalogue as key
> 'personalForm-textfield_7-regexp' or key 'textfield_7-regexp'.
>
>
>
> In the docs it says to use this format:
>
> <t:textfield t:id="ssn" validate="required,regexp"/>
>
> And your message catalogue can contain:
>
>
>
> ssn-regexp=\d{3}-\d{2}-\d{4}
>
> ssn-regexp-message=Social security numbers are in the format 12-34-5678.
>
>
>
> What am I missing?
>
>
>
> Thanks,
>
> --James
>
>
>
>
>
>


-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


---------------------------------------------------------------------
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: T5: Validation and message catalogue

Posted by James Sherwood <js...@rgisolutions.com>.
Hello,

It is not a matter of the text used in the validate(I actually did try it
though), it is a matter of tapestry either a: not finding the file or b: I
am implementing it wrong

--James

-----Original Message-----
From: Sven Homburg [mailto:homburgs@googlemail.com] 
Sent: February-02-09 11:33 AM
To: Tapestry users
Subject: Re: T5: Validation and message catalogue

try double slashed like this

ssn-regexp=\\d{3}-\\d{2}-\\d{4}

2009/2/2 James Sherwood <js...@rgisolutions.com>

> Hello,
>
>
>
> I cannot seem to get a textfield validate message to work using regexp and
> message catalogs.
>
>
>
> I use Tomcat/Eclipse.
>
>
>
> This is my .tml:
>
> <td><b>Cell Phone:</b></td>
>
> <td><t:textfield id="cellPhone" value="cellPhone"/></td>
>
>
>
> This is my java:
>
> @Validate("regexp")
>
> public String getCellPhone(){
>
> return getVisit().getNstuMember().getCellphone();
>
> }
>
> public void setCellPhone(String cellPhone){
> getVisit().getNstuMember().setCellphone(cellPhone);
>
> }
>
>
>
> This is my message catalogue:
>
> cellPhone-regexp=\d{3}-\d{2}-\d{4}
>
> cellPhone-regexp-message=Invalid Number EX: (555) 555-5555,5555555555
>
>
>
> I have tried placing it(Main.properties) everywhere and tapestry always
> throws this error:
>
> Render queue error in BeginRender[Main:textfield_7]: Failure reading
> parameter 'validate' of component Main:textfield_7: Validator 'regexp'
> requires a validation constraint (of type java.util.regex.Pattern) but
none
> was provided. The constraint may be provided inside the @Validator
> annotaton
> on the property, or in the associated component message catalogue as key
> 'personalForm-textfield_7-regexp' or key 'textfield_7-regexp'.
>
>
>
> In the docs it says to use this format:
>
> <t:textfield t:id="ssn" validate="required,regexp"/>
>
> And your message catalogue can contain:
>
>
>
> ssn-regexp=\d{3}-\d{2}-\d{4}
>
> ssn-regexp-message=Social security numbers are in the format 12-34-5678.
>
>
>
> What am I missing?
>
>
>
> Thanks,
>
> --James
>
>
>
>
>
>


-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com


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


Re: T5: Validation and message catalogue

Posted by Sven Homburg <ho...@googlemail.com>.
try double slashed like this

ssn-regexp=\\d{3}-\\d{2}-\\d{4}

2009/2/2 James Sherwood <js...@rgisolutions.com>

> Hello,
>
>
>
> I cannot seem to get a textfield validate message to work using regexp and
> message catalogs.
>
>
>
> I use Tomcat/Eclipse.
>
>
>
> This is my .tml:
>
> <td><b>Cell Phone:</b></td>
>
> <td><t:textfield id="cellPhone" value="cellPhone"/></td>
>
>
>
> This is my java:
>
> @Validate("regexp")
>
> public String getCellPhone(){
>
> return getVisit().getNstuMember().getCellphone();
>
> }
>
> public void setCellPhone(String cellPhone){
> getVisit().getNstuMember().setCellphone(cellPhone);
>
> }
>
>
>
> This is my message catalogue:
>
> cellPhone-regexp=\d{3}-\d{2}-\d{4}
>
> cellPhone-regexp-message=Invalid Number EX: (555) 555-5555,5555555555
>
>
>
> I have tried placing it(Main.properties) everywhere and tapestry always
> throws this error:
>
> Render queue error in BeginRender[Main:textfield_7]: Failure reading
> parameter 'validate' of component Main:textfield_7: Validator 'regexp'
> requires a validation constraint (of type java.util.regex.Pattern) but none
> was provided. The constraint may be provided inside the @Validator
> annotaton
> on the property, or in the associated component message catalogue as key
> 'personalForm-textfield_7-regexp' or key 'textfield_7-regexp'.
>
>
>
> In the docs it says to use this format:
>
> <t:textfield t:id="ssn" validate="required,regexp"/>
>
> And your message catalogue can contain:
>
>
>
> ssn-regexp=\d{3}-\d{2}-\d{4}
>
> ssn-regexp-message=Social security numbers are in the format 12-34-5678.
>
>
>
> What am I missing?
>
>
>
> Thanks,
>
> --James
>
>
>
>
>
>


-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com