Re: Int Validator
Thanks. Do you know how can I change below message: Invalid field value for field "amount" ?! ~Regards, ~~Alireza Fattahi From: Dave Newton To: Struts Users Mailing List Sent: Saturday, 13 July 2013, 16:16 Subject: Re: Int Validator The field value error comes from the type conversion process. The field should be an int or an Integer, with the caveat that an int has a default value of 0, which may not be desirable. Save On Jul 12, 2013 11:56 PM, "Alireza Fattahi" wrote: > Hi, > > I want to validate the amount filed to be an integer with minimum value of > 1 > I describe the field type as Integer (not int ) > Add below validation rule > > > ${getText("validate.required")} > > > 10 > ${getText("validate.int.min")} > > > > When the amount is empty I get validate.required error. > > When I type a text instead of integer I get Invalid field value for field > "amount" . I don't know where it comes from and how can I change it. > > Also please let me know if I should define the amount as int, Integer or > String ! > > > ~Regards, > ~~Alireza Fattahi
Re: Int Validator
The field value error comes from the type conversion process. The field should be an int or an Integer, with the caveat that an int has a default value of 0, which may not be desirable. Save On Jul 12, 2013 11:56 PM, "Alireza Fattahi" wrote: > Hi, > > I want to validate the amount filed to be an integer with minimum value of > 1 > I describe the field type as Integer (not int ) > Add below validation rule > > > ${getText("validate.required")} > > > 10 > ${getText("validate.int.min")} > > > > When the amount is empty I get validate.required error. > > When I type a text instead of integer I get Invalid field value for field > "amount" . I don't know where it comes from and how can I change it. > > Also please let me know if I should define the amount as int, Integer or > String ! > > > ~Regards, > ~~Alireza Fattahi
Int Validator
Hi, I want to validate the amount filed to be an integer with minimum value of 1 I describe the field type as Integer (not int ) Add below validation rule ${getText("validate.required")} 10 ${getText("validate.int.min")} When the amount is empty I get validate.required error. When I type a text instead of integer I get Invalid field value for field "amount" . I don't know where it comes from and how can I change it. Also please let me know if I should define the amount as int, Integer or String ! ~Regards, ~~Alireza Fattahi
int validator stopped working after upgrade to 2.1.8 from 2.1.6
Hello my int validator stopped working after upgrade to 2.1.8 from 2.1.6. Can someone please, provide some insight? My validators are defined like this and they used to work fine before. Now string validators are working but not the int ones. ... 1 2 xx must be selected Regards, Parminder Lehal
Re: required Int validator -How to.
ravi_eze wrote: hi, I see that the previous valid int value is being populated when i enter null in an integer text field. I want to show error in such a case. Any ideas how to get this done. The scenario is as follows: 1. When i enter no value in F1: i get validation error asking me to fill the field 2. now i enter a valid a valid integer but some other field (F2) an incorrect value. The page caomes back as expected. 3. NOw if i remove data from F1 and give correct value in F2 i see no validation error fired up. Debugging shows that Struts is returning me the old valid value of F1(int field) 4. if i give some string/ char in int field its throwing errors as expected. any help ??? Not without knowing what version of Struts you're using, since the specifics are quite different between S1 and S2. It would also be useful to include relevant configuration and code snippets, since that might make it easy to zero in on the problem. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
required Int validator -How to.
hi, I see that the previous valid int value is being populated when i enter null in an integer text field. I want to show error in such a case. Any ideas how to get this done. The scenario is as follows: 1. When i enter no value in F1: i get validation error asking me to fill the field 2. now i enter a valid a valid integer but some other field (F2) an incorrect value. The page caomes back as expected. 3. NOw if i remove data from F1 and give correct value in F2 i see no validation error fired up. Debugging shows that Struts is returning me the old valid value of F1(int field) 4. if i give some string/ char in int field its throwing errors as expected. any help ??? cheers, ravi -- View this message in context: http://www.nabble.com/required-Int-validator--How-to.-tp17761272p17761272.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] int validator for longs?
I got the same problem a few days ago, solved using the Conversion Validator: http://www.mail-archive.com/user@struts.apache.org/msg60494.html HTH P. - Original Message - From: "Jon Wilmoth" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, June 14, 2007 10:50 PM Subject: [S2] int validator for longs? >I noticed there's only two bundled numeric data type validator (int, >double). Is there any reason the S2 "int" validator can't be used for long >field validations (or other data types w/out decimals)? > > p.s. The http://struts.apache.org/2.x/docs/validation.html page is missing > a link for the double type details similar to the one that's available for > int (http://struts.apache.org/2.x/docs/int-validator.html). I'm assuming > the com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator > javadocs accurately describe the configurable params. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] int validator for longs?
I noticed there's only two bundled numeric data type validator (int, double). Is there any reason the S2 "int" validator can't be used for long field validations (or other data types w/out decimals)? p.s. The http://struts.apache.org/2.x/docs/validation.html page is missing a link for the double type details similar to the one that's available for int (http://struts.apache.org/2.x/docs/int-validator.html). I'm assuming the com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator javadocs accurately describe the configurable params. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]