cancel
Showing results for 
Search instead for 
Did you mean: 

Error in TextAreaGenerator if more than 1000 characters

ribz33
Champ on-the-rise
Champ on-the-rise
Hi,

i did a custom "LargeMultilingualTextAreaGenerator" based on MultilingualTextAreaGenerator with more rows and colums in order to allow user to type bigger text. This textarea is used in edit properties dialog.

If user type more than average 1000 characters i have error :
Could not execute JDBC batch update

Im using an Oracle database and it seems that string_value in alf_attributes is limited to 1024 characters (attributes.hbm.xml). So i want to find a way to alert contributor that he is limited to 1000 characters.

What is easy way to do that ?
Can i configure that somewhere (in model ?, in web-client-config ?) ? Can i do easily a javascript ?
Have you any suggestion ?

Thanks in advance.
1 REPLY 1

gavinc
Champ in-the-making
Champ in-the-making
The easiest way would be to use some client side JavaScript to alert or stop the user from entering more than 1000 chars.

There is a function in /scripts/validation.js called "validateStringLength" you could use this to check the string length as the user types i.e. attach an onkeyup handler.

Another option is to add a constraint to the property definition in the model, the client side validation should then be done for you, but this isn't the safest  upgrade route if it's an Alfresco property!