Re: T5: Validation and message catalogue

2009-02-02 Thread Sven Homburg
try double slashed like this

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

2009/2/2 James Sherwood jsherw...@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:

 tdbCell Phone:/b/td

 tdt: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-,55



 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


RE: T5: Validation and message catalogue

2009-02-02 Thread James Sherwood
Hello,

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

Thanks,
--James

-Original Message-
From: James Sherwood [mailto:jsherw...@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:hombu...@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 jsherw...@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:

 tdbCell Phone:/b/td

 tdt: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-,55



 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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


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



RE: T5: Validation and message catalogue

2009-02-02 Thread James Sherwood
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:hombu...@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 jsherw...@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:

 tdbCell Phone:/b/td

 tdt: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-,55



 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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org