The Rich Text control of a xpage is derived from CKEditor from lotus 8.5.2, however in previous versions it was a Dojo rich text editor.
A CKEditor control just created in a xpage doesn’t have Dojo attribute explicitly defined as shown in the figure below:
The toolbarType attribute is implicitly set to “Medium”, its default value, and defines a particular toolbar.
Setting toolbarType you choose the functionality of the toolbar at the top of the rich text and it can take 3 values which correspond to three different toolbars:
You can customize the toolbar with the attribute toolbar which is a JavaScript array containing the elements to be displayed in the toolbar.
For example, to set a basic toolbar, create an attribute “toolbar” and set its value as JavaScript (ServerSide) to:
var customToolbar="[['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']]"; return customToolbar;
If you want a full toolbar the value of “toolbar” is:
var customToolbar="[['Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates']," +"['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']," +"['Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt']," +"['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField']," +"'/'," +"['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']," +"['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl']," +"['Link','Unlink','Anchor']," +"['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe']," +"'/'," +"['Styles','Format','Font','FontSize']," +"['TextColor','BGColor']," +"['Maximize', 'ShowBlocks','-','About']]"; return customToolbar;
To obtain an empty toolbar, set “toolbar” to:
var customToolbar="[]"; return customToolbar;
References:
CKEditor 3.x Developer’s Guide
Leave a Reply