With no intentions to create yet another thread of "I dont like Validator
Framework". I just wanted to know if there was any way of using validation
framework to validate collections element, without writing
bean.collection[0].property for the property, as it might not be possible to
know the size of collection (else why would I use collection? )

To make it easier, a lot of times i have a collection of textboxes to be
populated with numbers, Is there any way of validating?

overriding validate() method of ActionForm, is not an option, as I am using
BeanValidatorForm. 


Thanks and Regards, 
Nitish Kumar 




-----Original Message-----
From: Borislav Sabev [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 14, 2005 3:34 PM
To: Struts Users Mailing List
Subject: Re: Validation framework


Rafael Taboada wrote:

>Hi folks I'm using validation framework in order to validate my fields in a

>form.
> I have three fields in a search form:
> strUsername
>strFromDate
>strToDate
> But we have the rule that the user can fill strUsername or use dates
range. 
>I mean he can search by username or he can search by dates range...
> When I use validation, it validates all the fields.... My question is how 
>can I set my search rule??? the user can search by username or by dates 
>range... If he choose username so validation only has to validate username 
>field... But if he choose dates range, so validation has to validate only 
>FromDate and ToDate...
> Any help would be appreciated...
> Thanks in advance.
>
>  
>
You have at least 3 choices:
1. client side validation i.e. to use javascript onSubmit to check such 
logic
2. write your own validator - see commons-validator for more info
3. validate it in the form.validate() metod
all 3 have +/- I recomend you the 3th method.

Regards
Borislav

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to