This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hey guys, Is there a way to customize the messages coming out when you validate an entity? Also, could it return an error code (maybe generated off the namespace, classname, property combo or something?) I need to work across different languages so it would be good to have error codes so I can do the translation... Any thoughts? James |
|
|
James, Let me take a look at this and get back to you. Cheers, Andrew. |
|
|
Thanks Andrew Another idea I had was to have an order/priority that you could attach to validation attributes - I could lookup and order them myself if I had some sort of error id but if this was added maybe that would also be handy. The thought being that if I add a user I would normally fill out there name, email address etc in a particular order on a form or in a grid - If I could tag up the priority of the errors coming out of the model then they would appear in a way that would be usefull/relevant to how the user was filling out the form. Just a thought :-) James |
|
|
Hi James, I've checked in (1.2 branch) a small localization sample that shows how to localize LightSpeed's internal resources using standard .NET satellite assemblies. This is the preferred way to handle multiple cultures. With respect to validation message ordering having the ordering at the model level strikes me as coupling the model to the UI. A better approach may be to simply leverage the property name exposed by the ValidationError object and use that to map back to the UI elements. Happy to hear your thoughts Andrew. |
|
|
Thanks for the sample! I'll take a look asap Yeah that is a point - Its something that can be quite hard when you have validation at the model level (and binding to it) and you don't want to scatter work around. Its something I'll think over further and get back to you on - I've been working on some bits and pieces already and I think its panning out pretty well/it may bring some more ideas to the surface... Thanks again James |
|