I' making a component that required a rich text field in the dialog. It is working, but the properties maxlength and required do nothing for this field. I have them configured properly but I can add any number of characters and save the dialog with no text in my rich textfield. I did the component taking as a base the richtextfield in /libs/foundation/components/text component because it has a rich text inside the dialog similar to the one I need.
I've attached an image with my configuration,
I need to make the maxlegth and required properties work
Solved! Go to Solution.
Views
Replies
Total Likes
The RTE does not support max length and required properties.
Alternatively you can use allowBlank= false for required and for maxlength you can add a listener (validator) on click of OK button of dialog checking the length of the characters entered in RTE and validate accordingly.
Views
Replies
Total Likes
Try using this data type:
Views
Replies
Total Likes
I need rich text editing capabilities, so using textarea does not solve my problem
Views
Replies
Total Likes
The RTE in Touch UI is not a granite Data type like TextArea i listed above and does not ahve the same properties. Its a script located here:
/libs/cq/gui/components/authoring/dialog/componentstyles/componentstyles.jsp
To get this functionality - you would need to overlay the script and modify the application logic to support a max length.
Views
Replies
Total Likes
The RTE does not support max length and required properties.
Alternatively you can use allowBlank= false for required and for maxlength you can add a listener (validator) on click of OK button of dialog checking the length of the characters entered in RTE and validate accordingly.
Views
Replies
Total Likes
allowBlank= false for required how can we add this can yo please help with the screenshot
Views
Replies
Total Likes
Add a property "validateValue" in your rte field and add this function as the value, This is working for me. Change the length in if condition according to your need.
function(field){
var temp=this.getValue();
if(temp.length>500){
this.markInvalid("Description should not exceed 500 characters");
return false;
}else{
this.clearInvalid();
return true;
}
}
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies