Let us create an Editor component and see how to use it as a rich text editor and perform various operations using client-side API methods:
Create a form with the
<p:editor>
component and buttons to invoke various client-side API methods.<h:form id="form1"> <p:editor id="buzzText" widgetVar="editor" value="#{postController.newPost.description}" controls="bold italic underline strikethrough font numbering size color source"/> <p:commandButton type="button" value="Submit" update="display" oncomplete="dlg.show()" /> <p:commandButton type="button" value="Clear" onclick="editor.clear()"/> <p:commandButton type="button" value="Enable" onclick="editor.enable()" /> <p:commandButton type="button" value="Disable" onclick="editor.disable()" /> <p:commandButton type="button" value="SelectAll" onclick="editor.selectAll()" /> <p:commandButton type="button...