Expand my Community achievements bar.

SOLVED

Form Checkbox Customization Story

Avatar

Former Community Member

I am working on customizing the Form Checkbox Group. This form checkbox group basically contain a multified where you can add number of checkboxes. This multified is of default text-field type. The need is to replace this textfield to a rich-text, so that the text in it will have the rich text capabilities. I have edited the checkbox component and added a field-config node of cq:Widget type and xytpe rich-text. On dialog level the textfield got replaced with richtext which in case is the need. 

The problem is after refresing the page, first time on editing the dialog the rich text works ok. But on editing second time it throws a JS error Uncaught Type error: cannot set property ‘value ’of undefined on richtext.js available at /libs/cq/ui/widgets/source/widgets/form/RichText.js.

 

This was the one work around I did, but got stuck. Is there any other work around for this or any solution approach to handle this error.

1 Accepted Solution

Avatar

Correct answer by
Level 10

That is expected. You need to implement additional customization to rendering HTML with Javascript or other means.

View solution in original post

5 Replies

Avatar

Level 10
Did you solve this issue?       

Avatar

Level 10

Overlay [1] for the method syncValue & replace [2] with [3].

[1] /libs/cq/ui/widgets/source/widgets/form/RichText.js

[2] this.el.dom.value = html;

[3] if(this.el.dom){this.el.dom.value = html;}

Avatar

Former Community Member

Hi Sham,

Thanks for the reply, I already did what you are saying. The error got removed, but another problem which came is it writes down the html tag attribute with text itself on the page. For eg. my text is 

"Please confirm something something. Also please check asdf asd asda dthe dada" .

But the text rendered on page is with p tag.

"<p>Please confirm something something. Also please check asdf asd asda dthe dada</p>"

and if I marked some text as bold the result is

<p>Please confirm that<strong> something something</strong> are for the mortgage you've chosen. Also please check asdf asd asda dthe dada</p>

Avatar

Correct answer by
Level 10

That is expected. You need to implement additional customization to rendering HTML with Javascript or other means.