PDA

View Full Version : Validation for Coolite Controls



r_honey
Nov 10, 2009, 2:34 AM
One thing I have always found lacking with Coolite ASP.NET server
controls was integration with the validation framework of ASP.NET, that
prevents submission of a form if any control state is invalid according
the the Validators associated with that control.

No doubt, the ExtJs
client controls that Coolite server controls translate to provide good
& extensible client-side validation, but that does not perform the
form from being submitted unless you have put your controls inside a
FormPanel, & manually check for validation when the FormPanel is
submitted.

I created a CooliteValidator class, that inherits from
the ASP.NET BaseValidator class. You just drop the Vaidator on the form, and
associate it to a Coolite control (CooliteValidator throws an exception
if you try to associate it to a non-Coolite TextFieldBase control).

More details on the control are available on my blog post:
http://www.rahulsingla.com/blog/coolite-control-validation

The code for the control can be downloaded from the link below the post. The direct link is below:
http://www.rahulsingla.com/sites/default/files/content/blog/coolite_control_validation/CooliteValidationControl.zip

It would be interesting to see what the Coolite team thinks about my control. I would request them to have a look at it. If they find it suitable, I would be willing to turn it over for inclusion in the Coolite toolkit with absolutely no strings attached.

geoffrey.mcgill
Nov 10, 2009, 2:42 AM
Hi r_honey,

Thanks for making the validation control, and the blog post! I'm certain others will find this very helpful.


I agree... the server-side Validation control support needs some attention. This has been a big TODO item on my list for a while but we've just found it difficult to find the time to devote to solving the problem.


I'll read through your blog post and code in detail and let you know if I/we have any suggestions.

r_honey
Nov 10, 2009, 3:06 AM
Sure, I would be all ears for any suggestions!!!

A reply to the following thread:

http://forums.ext.net/showthread.php?5710

would help me improve this control.

r_honey
Nov 10, 2009, 3:54 AM
geoff, there was a minor error in the Control code, which prevented it from working properly on FF. I have removed it. Please update the Code from the link above, if you have already downloaded it.

r_honey
Nov 16, 2009, 5:05 AM
Hi geoff, as you said, any suggestions???