Can validation block be used with databinding?

Topics: Validation Application Block
Jul 1, 2008 at 6:32 AM
If my business object has hundreds of fields, I don't want to create a class having hundreds of properties to represent it. So is there still a way that I can take advantage of EL to do the validations in the databinding scenario where controls on UI are bound to data source like BindingSource component?

Thanks for any clue.
Jul 1, 2008 at 3:03 PM
Hi,

You should be able to create validator instances, but the configuration support and obviously the attribute-based support require actual types. You'd need to rely on code or create a new way to specify the validation rules for each piece of data.

Fernando


buaaytt wrote:
If my business object has hundreds of fields, I don't want to create a class having hundreds of properties to represent it. So is there still a way that I can take advantage of EL to do the validations in the databinding scenario where controls on UI are bound to data source like BindingSource component?

Thanks for any clue.



Jul 2, 2008 at 2:27 AM
Thanks Fernando. In that case, I think I'll just try to extract some core classes, like Validator, ValidationResult, and so forth, from the library and simplify them to adapt to my project, cos I feel it too complicated to just use the Validator directly but have to introduce those configuration and attribute related classes as well.