This is a migrated thread and some comments may be shown as answers.

Validation Design Impractical

5 Answers 181 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 19 Jun 2012, 09:45 AM
The current design of your validators requires you to build the validator directly into the view.  This information should instead be coming directly from the model and should be applied to the view via attributes applied by the model binding.  Designing it the way you have causes a great deal more coding than would otherwise required with model binding.  Is there any chance I can provide a speclet for how the validators should working using binding with the model to get this in the feature pipeline?

Your friendly super high performance service guy,
Jeff Fischer

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Jun 2012, 10:22 AM
Hello,

The Kendo Validator is built around HTML5 form validation. The same relies on HTML attributes which are indeed defined in the view.

 I guess you want Kendo MVVM to generate those attributes during MVVM binding based on the kendo.data.Model field declaration. Is that correct? 

 In any case you may consider creating a new item in our user voice page. We would prioritize it based on user demand.

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jeff
Top achievements
Rank 1
answered on 20 Jun 2012, 08:43 PM
It appears it's possible to utilize the model to control the validation.  It would be great to get a link from the Validator section over to the DataSource Model section to move people in that direction (it's likely a more useful implementation).  There's also pretty

http://www.kendoui.com/documentation/framework/datasource/configuration.aspx#model

Also, more detail documentation around the rules configuration structure would be very helpful.

http://www.kendoui.com/documentation/framework/validator/configuration.aspx#rules

The current documentation gives you no understanding of whether you can add more than one custom method off of the rules property or whether you're supposed to do all of your processing inside of the single custom method.

Thanks,
Jeff
0
Accepted
Justin
Top achievements
Rank 1
answered on 27 Jun 2012, 01:19 AM
After doing some deeper searching, I came across this forum post that might prove helpful to all who want to do validation.

http://www.kendoui.com/forums/framework/validation/unable-to-get-custom-validation-working-on-a-grid.aspx 

Perhaps the admin can confirm, but this looks like it will work with all Kendo UI web widgets: 

UI WIDGETS








 

 
The only thing missing from making that page a complete resource is an answer on how to access the validators for each of the widgets, so that one can do things like check for accumulated errors, say for a logger, or getting a callback to confirm validation worked before performing other operations.
0
Jeff
Top achievements
Rank 1
answered on 04 Jul 2012, 07:46 PM
I added a UserVoice suggestion to be able to DataSource the model (with validation) and request it from the server rather than hard code it into the client.  Place your votes here - http://kendo.uservoice.com/forums/127393-kendo-ui-feedback/suggestions/2976821-datasource-model-separately-datasourcable.

Thanks,
Jeff
0
Craig
Top achievements
Rank 1
answered on 20 May 2013, 06:46 PM
Although I see your point you are trying to make, I want to mention that moving the validation to the  viewModels (which is usually a good idea) or the data source would be counter-productive in the case of Kendo. The reason being is that many developers who use Kendo UI employ another method for managing their models other than the Kendo Datasource and Kendo MVVM. If all the validation was moved away from the opt-in validation Kendo provides into the MVVM or Datasource this would be tying developers into doing something many would prefer to do otherwise. This is highlighted by many of the project currently under development in labs.kendoui.com.

I believe that if your are REALLY that concerned about how clean your data is, I suspect you should be putting Validation at each point along the way by way of keeping validation off the transport layer (which is one of the things the Datasource manages). Put validation on the server side on your 'real' models if you need that level of validation.

Finally, I just wanted to mention that another very large software company 'forced' us into their 'validation on the models' in ASP.NET web-forms which (shockingly) really irritated a lot of developers by forcing them to do things and tying their hands from doing really neat 'other' things.

Just my $.02, take it or leave it - I just wanted to put some food for thought on the table.

-Cheers!
Tags
Validation
Asked by
Jeff
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jeff
Top achievements
Rank 1
Justin
Top achievements
Rank 1
Craig
Top achievements
Rank 1
Share this question
or