Editor is an input component with rich text editing capabilities. The Editor component comes with a toolbar containing various options to apply HTML styles. The Editor component can be created as follows:
<p:editor id="buzzText" value="#{postController.newPost.description}"/>
We can customize the toolbar options using the controls
attribute as follows:
<p:editor id="buzzText" value="#{postController.newPost.description}" controls="bold italic underline strikethrough font numbering size color source" />
With this customization, the Editor looks like the following screenshot:
The following is the full list of all available controls:
The <p:editor>
component provides the following client-side API methods:
Method |
Description |
---|---|
|
Initializes a lazy editor, subsequent calls do not reinitialise the editor. |
|
Saves HTML text in iframe back to the textarea. |
|
Clears the text in the editor. |
|
Enables editing. |
|