Page 1 of 1

pe:ckEditor insertText from bean

Posted: 14 Sep 2018, 09:55
by vished
Hi all,

I´m trying to add an text from my bean to my pe:ckEditor. This is working, but I would like to add also HTML text etc.

Code: Select all

<p:commandButton global="false" update=":growl"
value="TEST" icon="fa fa-copy" />

Code: Select all

	<pe:ckEditor widgetVar="editorWidgetVar" width="100%"
													toolbar="[[ 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor',  'Undo','Redo' ],[ 'Styles', 'Format', 'Font', 'FontSize' ],
                  								[ 'Image', 'Table' ], [ 'Link', 'Unlink' ],
                  								[ 'NumberedList', 'BulletedList', 'JustifyLeft', 'JustifyCenter','JustifyRight', 'JustifyBlock'], ['Source' ]
If I have a normal text like "TEST" than it´s working. But for HTML code / line break etc. it seems not working.
I got in Firebug this error message:

SyntaxError: '' string literal contains an unescaped line break

Any ideas?

Re: pe:ckEditor insertText from bean

Posted: 14 Sep 2018, 14:08
by Melloware
You probably have to escape the value of #{}

In your backing bean trying and use Commons Lang StringEcapeUtils and do escapeHtml() or something like that.