O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – using editor client-side API methods

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:

  1. 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" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required