user friendly validation messages

Topics: Feature requests, General
May 17, 2011 at 3:06 PM

Hi All,

Is that possible to replace standard validation error messages with own ? For example to show "Help Text" instead of validation error messages.

 

Thanks,

Ruslan

Coordinator
May 18, 2011 at 8:56 AM
Edited May 18, 2011 at 8:56 AM

The validators that ship with Composite C1 don't have features that allow you to customize the error message. You probably need to write your own validator: http://docs.composite.net/C1/FAQ/Developer.aspx?q=How+to+add+custom+validation%3F

May 30, 2011 at 7:51 AM
Edited May 30, 2011 at 8:03 AM

hi @mawtex,

 

I have started a development of own validators and what i figured out :

1) Standard validation provided by Composite C1 doesn't work (TextArea, DataIdMultiSelector widgets):

Log record : 

  30/05/2011 10:20
Validator function markup parse / execution failed with the following error: 'The Function named 'Composite.Utils.Validation.StringLengthValidation' is not known.'. The validator attribute is dropped.
InterfaceCodeGenerator Error

2) My own validator in separate assembly (not App_Code) doesn't work :

  30/05/2011 10:19
Validator function markup parse / execution failed with the following error: 'The Function named 'Composite.Utils.Validation.StringLengthValidation' is not known.'. The validator attribute is dropped.
InterfaceCodeGenerator Error

3) I have faced some issues reported by me earlier 

  30/05/2011 10:19
Compilation returned error (101: The type or namespace name 'Vehicle' does not exist in the namespace 'DESCUBRE.Data' (are you missing an assembly reference?)
BulidManager Error

http://compositec1.codeplex.com/discussions/247394 (Issue2 : BuildManager errors)

 

C1 info:

Composite C1 2.1.1
Build no. 2.1.4113.99

Installation ID:a0ce3023-5c36-4e4a-bb80-eb4ed087576e

Could you please help me with instructions how can I proceed ?

 

Rgds, Ruslan

Coordinator
May 30, 2011 at 11:54 AM

I know answer to the second one

>> My own validator in separate assembly (not App_Code) doesn't work :

As it is designed at the moment, validators cannot be defined in /App_Code, only in "/bin" dll-s. The reason for it is that those validators are used while generating Composite.Generated.dll, and you obviously cannot have a code in a dll that would reference a dynamically compiled App_Code.

So, it you put it inside a dll, that should work.

As for 3), try steps I suggested here http://compositec1.codeplex.com/workitem/664, that should help

May 30, 2011 at 12:05 PM

hi @napernik,

Thanks for the reply!

2)I have created my validators in separate DLL(assembly) named DESCUBRE.Common.dll and placed the DLL in /Bin.  I confirm that any validator related  C# code in /App_Code

3) Yes, it can be be temporary solution. But next time when I change datatype(new fields, new validator, etc) it will be broken again.

 

Rgds, Ruslan

May 31, 2011 at 9:42 AM

hi @napernik,

I just sent my website to @MartinJensen as part of another discussion http://compositec1.codeplex.com/discussions/257748.

Maybe you can have a look on it as well to resolve all your doubts concerning  /App_Code

if yes, you can try create an instance of DESCUBRE.Data.Tour and see the behavior of built-in C1's validators.

 

Regards, Ruslan