Integrate Model validation on every textchanged event? - Validation Block -

Topics: Validation Application Block
Jun 25, 2009 at 8:21 AM

Hello,

I do not want to validate the userinput or model properties when the textboxFirstName lost his focus, I want to validate each time a key is pressed or the textchanged event is raised.

How can I integrate this feature into the static looking validation block from enterprise library 4.1 ?

Please help :)

Jun 25, 2009 at 9:16 AM

You can manually call validationProvider.PerformValidation(nameOfControl) in the TextChanged event of the textbox.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Jun 25, 2009 at 9:20 PM

thank you at first for you help!

I also thought of using the PerformValidation method in the TextChanged event but wasnt sure good you confirmed it :)

 

What I do not like about the validation block that it is not compatible with the MVP Design Pattern which I am used to. The model is instantiated in the View and the ErrorProvider and ValidationProvider is bound to my textbox controls. I would like to

have a loose coupling like in WPF with MVVM Pattern where the View does not know of the Model etc... Do you have any suggestion how to use the Validation Block with MVP Design Pattern?

Jun 26, 2009 at 7:10 AM

Hi,

Please see this link: http://blog.raffaeu.com/archive/2009/03/15/ui-validation-with-the-mvp-pattern.-part01.aspx and http://blog.raffaeu.com/archive/2009/03/15/ui-validation-with-the-mvp-pattern.-part02.aspx.

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Jun 26, 2009 at 8:12 AM

thank you again. I will wait for the third blog post from raffaeu which deals with proper mvp integration and the validatorprovider

Jul 14, 2009 at 8:26 PM

I guys, sorry for the late answer, I will properly post the final solution maybe this week-end.

Thank you Dudan for the postback!

Jul 15, 2009 at 10:39 PM

Hi guys this is the article with the final solution over sky drive.

Enjoy and let me know what you think about it, in my blog.

Thank you so much!

http://blog.raffaeu.com