[REPOST] [Validator] REQUIREDIF Question
I'm reposting this in the hope that someone can tell what I'm doing wrong. I can't seem to figure out why this doesn't work. Any (and all) help is greatly appreciated I have a rather simple form with 4 fields on it. If the first field (patientId) is left blank, then the other three fields (lastName, firstName, dob) are required. So, in struts-config I have snip form-bean name=UserInfo type=org.apache.struts.validator.DynaValidatorForm form-property name=lastName type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=dob type=java.lang.String/ form-property name=patientId type=java.lang.String/ /form-bean /snip and in my validator-rules I am using snip formset form name=UserInfo field property=patientId depends=mask msg name=mask key=errors.field.invalid / arg0 key=UserInfo.patientId.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var /field field property=lastName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.lastName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=firstName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.firstName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=dob depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.dob.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field /form /formset /snip The REQUIREDIF check does not seem to be working as the validation is passed successfully. I suspect it has something to do with the form property being a String, but being checked against a NULL in validator. I checked the validator docs and this appears to be the correct way of doing this. Am I just missing something obvious? TIA! Jerry Jalenak Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and
RE: [REPOST] [Validator] REQUIREDIF Question
Nothing out of the ordinary jumps out from what you have sent. That being said, following are a few points; a list which you have probably already checked and double-checked: * Have you set the validator plug-in element in the struts-config? * Is the name of the form-bean in the action mapping also UserInfo? * Have you ensured that the requiredIf logic is being invoked at all? You could test this by say, changing the logic (just for test purposes). For example, change the NULL criterion to some dummy string literal. Then actually enter that literal on the JSP and see if the requiredif logic is triggered Sri -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:38 AM To: '[EMAIL PROTECTED]' Subject: [REPOST] [Validator] REQUIREDIF Question I'm reposting this in the hope that someone can tell what I'm doing wrong. I can't seem to figure out why this doesn't work. Any (and all) help is greatly appreciated I have a rather simple form with 4 fields on it. If the first field (patientId) is left blank, then the other three fields (lastName, firstName, dob) are required. So, in struts-config I have snip form-bean name=UserInfo type=org.apache.struts.validator.DynaValidatorForm form-property name=lastName type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=dob type=java.lang.String/ form-property name=patientId type=java.lang.String/ /form-bean /snip and in my validator-rules I am using snip formset form name=UserInfo field property=patientId depends=mask msg name=mask key=errors.field.invalid / arg0 key=UserInfo.patientId.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var /field field property=lastName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.lastName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=firstName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.firstName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=dob depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.dob.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field /form
RE: [REPOST] [Validator] REQUIREDIF Question
Sri - thanks for the reply. We have several other validations going on with this form-bean, so I'm confident that your first two items are OK. I've also pulled the 'REQUIREDIF' check out of the validation in question (leaving just the MASK) and everything behaves correctly. I've also been over the validator docs countless times, and have verified that the general approach matches what is in the doc. The only thing I can come up with is that the MASK processing is screwing things up some way I'm about to a point of writing a custom validation routine just to get by this, but would sure like to use the REQUIREDIF Jerry -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:35 AM To: Struts Users Mailing List Subject: RE: [REPOST] [Validator] REQUIREDIF Question Nothing out of the ordinary jumps out from what you have sent. That being said, following are a few points; a list which you have probably already checked and double-checked: * Have you set the validator plug-in element in the struts-config? * Is the name of the form-bean in the action mapping also UserInfo? * Have you ensured that the requiredIf logic is being invoked at all? You could test this by say, changing the logic (just for test purposes). For example, change the NULL criterion to some dummy string literal. Then actually enter that literal on the JSP and see if the requiredif logic is triggered Sri -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:38 AM To: '[EMAIL PROTECTED]' Subject: [REPOST] [Validator] REQUIREDIF Question I'm reposting this in the hope that someone can tell what I'm doing wrong. I can't seem to figure out why this doesn't work. Any (and all) help is greatly appreciated I have a rather simple form with 4 fields on it. If the first field (patientId) is left blank, then the other three fields (lastName, firstName, dob) are required. So, in struts-config I have snip form-bean name=UserInfo type=org.apache.struts.validator.DynaValidatorForm form-property name=lastName type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=dob type=java.lang.String/ form-property name=patientId type=java.lang.String/ /form-bean /snip and in my validator-rules I am using snip formset form name=UserInfo field property=patientId depends=mask msg name=mask key=errors.field.invalid / arg0 key=UserInfo.patientId.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var /field field property=lastName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.lastName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=firstName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.firstName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=dob depends=requiredif, mask
RE: [REPOST] [Validator] REQUIREDIF Question
The only thing I can come up with is that the MASK processing is screwing things up some way One way to confirm that would be to remove the mask test. Jerry Sri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [REPOST] [Validator] REQUIREDIF Question
I'll take a look at this later today. There have been a number of people saying that they have had problems with REQUIREDIF, so I want to make sure it's still working. James -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:38 AM To: '[EMAIL PROTECTED]' Subject: [REPOST] [Validator] REQUIREDIF Question I'm reposting this in the hope that someone can tell what I'm doing wrong. I can't seem to figure out why this doesn't work. Any (and all) help is greatly appreciated I have a rather simple form with 4 fields on it. If the first field (patientId) is left blank, then the other three fields (lastName, firstName, dob) are required. So, in struts-config I have snip form-bean name=UserInfo type=org.apache.struts.validator.DynaValidatorForm form-property name=lastName type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=dob type=java.lang.String/ form-property name=patientId type=java.lang.String/ /form-bean /snip and in my validator-rules I am using snip formset form name=UserInfo field property=patientId depends=mask msg name=mask key=errors.field.invalid / arg0 key=UserInfo.patientId.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var /field field property=lastName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.lastName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=firstName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.firstName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=dob depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.dob.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field /form /formset /snip The REQUIREDIF check does not seem to be working as the validation is passed successfully. I suspect it has something to do with the form property being a String, but being checked against a NULL in validator. I checked the validator docs and this appears to be the correct way of doing this. Am I just missing something obvious? TIA! Jerry Jalenak Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913
RE: [REPOST] [Validator] REQUIREDIF Question
The problem, sir, lies not in your requiredif, but in your mask. When you say: var-value^[A-Za-z -']+$/var-value What you're literally saying is A to Z, a to z, and space to '. What you want to say is: var-value^[A-Za-z\ \-\']+$/var-value When I used the correct mask, everything worked correctly. (i.e., if patientId was blank, the other three fields were required and had to obey the mask. If patientId was not black, the other three could be.) James -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 10:02 AM To: 'Struts Users Mailing List' Subject: RE: [REPOST] [Validator] REQUIREDIF Question Sri - thanks for the reply. We have several other validations going on with this form-bean, so I'm confident that your first two items are OK. I've also pulled the 'REQUIREDIF' check out of the validation in question (leaving just the MASK) and everything behaves correctly. I've also been over the validator docs countless times, and have verified that the general approach matches what is in the doc. The only thing I can come up with is that the MASK processing is screwing things up some way I'm about to a point of writing a custom validation routine just to get by this, but would sure like to use the REQUIREDIF Jerry -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:35 AM To: Struts Users Mailing List Subject: RE: [REPOST] [Validator] REQUIREDIF Question Nothing out of the ordinary jumps out from what you have sent. That being said, following are a few points; a list which you have probably already checked and double-checked: * Have you set the validator plug-in element in the struts-config? * Is the name of the form-bean in the action mapping also UserInfo? * Have you ensured that the requiredIf logic is being invoked at all? You could test this by say, changing the logic (just for test purposes). For example, change the NULL criterion to some dummy string literal. Then actually enter that literal on the JSP and see if the requiredif logic is triggered Sri -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:38 AM To: '[EMAIL PROTECTED]' Subject: [REPOST] [Validator] REQUIREDIF Question I'm reposting this in the hope that someone can tell what I'm doing wrong. I can't seem to figure out why this doesn't work. Any (and all) help is greatly appreciated I have a rather simple form with 4 fields on it. If the first field (patientId) is left blank, then the other three fields (lastName, firstName, dob) are required. So, in struts-config I have snip form-bean name=UserInfo type=org.apache.struts.validator.DynaValidatorForm form-property name=lastName type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=dob type=java.lang.String/ form-property name=patientId type=java.lang.String/ /form-bean /snip and in my validator-rules I am using snip formset form name=UserInfo field property=patientId depends=mask msg name=mask key=errors.field.invalid / arg0 key=UserInfo.patientId.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var /field field property=lastName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.lastName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=firstName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.firstName.displayname
RE: [REPOST] [Validator] REQUIREDIF Question
James, You, sir, are wy wiser in the use of regular expressions than I hope to ever be. The whole escape this, don't escape that thing continues to confound me. Anyway, I've updated my validator.xml with the changes to the mask, and it appears to be working (i.e. it returns to the original input form). However, I am not getting any messages displayed via my html:errors/ tag. I've checked and the default validator messages are in my ApplicationResources.properties, and have verified that it is being loaded (at least according to the Tomcat console log). Has something changed in how messages are rendered recently? I'm using the nightly build from Feb. 10, 2003 Any ideas? TIA! Jerry -Original Message- From: James Turner [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 11:48 AM To: 'Struts Users Mailing List' Cc: [EMAIL PROTECTED] Subject: RE: [REPOST] [Validator] REQUIREDIF Question The problem, sir, lies not in your requiredif, but in your mask. When you say: var-value^[A-Za-z -']+$/var-value What you're literally saying is A to Z, a to z, and space to '. What you want to say is: var-value^[A-Za-z\ \-\']+$/var-value When I used the correct mask, everything worked correctly. (i.e., if patientId was blank, the other three fields were required and had to obey the mask. If patientId was not black, the other three could be.) James -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 10:02 AM To: 'Struts Users Mailing List' Subject: RE: [REPOST] [Validator] REQUIREDIF Question Sri - thanks for the reply. We have several other validations going on with this form-bean, so I'm confident that your first two items are OK. I've also pulled the 'REQUIREDIF' check out of the validation in question (leaving just the MASK) and everything behaves correctly. I've also been over the validator docs countless times, and have verified that the general approach matches what is in the doc. The only thing I can come up with is that the MASK processing is screwing things up some way I'm about to a point of writing a custom validation routine just to get by this, but would sure like to use the REQUIREDIF Jerry -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:35 AM To: Struts Users Mailing List Subject: RE: [REPOST] [Validator] REQUIREDIF Question Nothing out of the ordinary jumps out from what you have sent. That being said, following are a few points; a list which you have probably already checked and double-checked: * Have you set the validator plug-in element in the struts-config? * Is the name of the form-bean in the action mapping also UserInfo? * Have you ensured that the requiredIf logic is being invoked at all? You could test this by say, changing the logic (just for test purposes). For example, change the NULL criterion to some dummy string literal. Then actually enter that literal on the JSP and see if the requiredif logic is triggered Sri -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 8:38 AM To: '[EMAIL PROTECTED]' Subject: [REPOST] [Validator] REQUIREDIF Question I'm reposting this in the hope that someone can tell what I'm doing wrong. I can't seem to figure out why this doesn't work. Any (and all) help is greatly appreciated I have a rather simple form with 4 fields on it. If the first field (patientId) is left blank, then the other three fields (lastName, firstName, dob) are required. So, in struts-config I have snip form-bean name=UserInfo type=org.apache.struts.validator.DynaValidatorForm form-property name=lastName type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=dob type=java.lang.String/ form-property name=patientId type=java.lang.String/ /form-bean /snip and in my validator-rules I am using snip formset form name=UserInfo field property=patientId depends=mask msg name=mask key=errors.field.invalid / arg0 key=UserInfo.patientId.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var /field field property=lastName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid
[Validator] REQUIREDIF Question
Hi All, I have a rather simple form with 4 fields on it. If the first field (patientId) is left blank, then the other three fields (lastName, firstName, dob) are required. So, in struts-config I have snip form-bean name=UserInfo type=org.apache.struts.validator.DynaValidatorForm form-property name=lastName type=java.lang.String/ form-property name=firstName type=java.lang.String/ form-property name=dob type=java.lang.String/ form-property name=patientId type=java.lang.String/ /form-bean /snip and in my validator-rules I am using snip formset form name=UserInfo field property=patientId depends=mask msg name=mask key=errors.field.invalid / arg0 key=UserInfo.patientId.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var /field field property=lastName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.lastName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=firstName depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.firstName.displayname / var var-namemask/var-name var-value^[A-Za-z -']+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field field property=dob depends=requiredif, mask msg name=requiredif key=errors.field.required / msg name=mask key=errors.field.invalid / arg0 key=UserInfo.dob.displayname / var var-namemask/var-name var-value^[0-9]+$/var-value /var var var-namefield[0]/var-name var-valuepatientId/var-value /var var var-namefield-test[0]/var-name var-valueNULL/var-value /var /field /form /formset /snip The REQUIREDIF check does not seem to be working as the validation is passed successfully. I suspect it has something to do with the form property being a String, but being checked against a NULL in validator. I checked the validator docs and this appears to be the correct way of doing this. Am I just missing something obvious? TIA! Jerry Jalenak Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please