From Documentation



You need to include CKEditor jar in pom.xml before using it because it has a different group id from ZK other components.


Check the latest version on CE repository.


The component is a wrapper of CKEditor

CKEditor is a popular HTML on-line text editor developed by Frederico Caldeira Knabben. It is used inside web pages. It's a WYSIWYG editor, which means that the text being edited on it looks as similar as possible to the results users have when publishing it. It brings to the web common editing features found on desktop editing applications like Microsoft Word and OpenOffice.


ZKCompRef CKEditor.png

<ckeditor width="850px">
<attribute name="value"><![CDATA[
<table width="200" cellspacing="1" cellpadding="1" border="1">
		<tr style="background: #B7B313; color:white;">
			<td>First Name</td>
			<td>Last Name</td>

ZKCompRef CKEditor2.png

It will turn on the save button when inside a form

<zk xmlns:n="">
		<ckeditor width="850" />

File browser

ZK CKEditor provides a default file browser for browsing the files in a folder that you specify. You can define a target folder in index.zul and when you open the add image/flash dialog and click "Browse Server", CKEditor will open a new window, and list all the files in the file browser.

ZKCompRef CKEditor filebrowser.png
    <ckeditor filebrowserImageBrowseUrl="img"/>

ZKCompRef CKEditor filebrowser2.png ZKCompRef CKEditor filebrowser3.png

Custom File browser


If you wish to customize your own file browser, you can change the location by calling CKeditor.setFilebrowserImageUploadUrl(page_url), and refer to CKEditor Developers Guide to create your custom file browser.

File upload


This feature is only enabled when you specify filebrowserImageUploadUrl attribute. ZK CKEditor provides a default file upload handler for uploading the files to the folder you specify. You can only specify a folder under the web context root because a web application can access its own folder.

ZKCompRef CKEditor filebrowser.png
    <ckeditor filebrowserImageBrowseUrl="img" filebrowserImageUploadUrl="img"/>

ZKCompRef CKEditor fileupload.png ZKCompRef CKEditor fileupload2.png

Custom File upload handler


If you wish to customize your own file upload handler, you can change the location by calling CKeditor.setFileUploadHandlePage(page_url), and refer to CKEditor Developers Guide to create your custom file upload handler.

Copy-Paste Images

You need to enable file upload to allow copying a local image from your machine to CKEditor.

Since If file upload is enabled, pasting a local image will upload the image to the server. If it's disabled, pasting a local image will insert an image with data URL.

Custom Configuration

Prepare a javascript file for configuration like:


CKEDITOR.editorConfig = function(config) {
    //enable spell checker
    config.disableNativeSpellChecker = false;
    //Automatically enables "Spell Check As You Type" on editor startup
    config.scayt_autoStartup = true;
    config.language = 'de';

Please refer to!/api/CKEDITOR.config for complete configuration options.

Specify the configuration file at customConfigurationsPath attribute with the absolute path.

<ckeditor customConfigurationsPath="/config.js"/>

Custom Save Button

You can implement a custom plugin to enable the save button and fire the onChange event to the server to save the editor's content. Please refer to on the github.

resizable attribute and sizing


default: true

The ckeditor container can be set resizable with the resizable attribute since

 <ckeditor resizable="true" .../>

If resizable="true" (default) is set, and the editor has not received a set height (from height="" or vlflex="" attributes), the whole component height will be modified on user resizing. In this case the editor outer div dimensions change to accommodate the new size set by the user.

If the component is resizable and has received a set height, it will display a scrollbar in order to maintain its declared size, but allow the user to modify the height of the editing space. In this case, the editor outer div dimensions do not change.

Plugin Installation

  1. Download a plugin according to CKEditor version
    ZK Ckedtiror version aligns the bundled CKEditor version.
  2. put plugin folder into zkckeditor's plugins folder
    In ZK, you have to copy the plugin folder into the folder below: (assuming a Maven project)
  3. setup in a custom config js
    Then provide a config.js mentioned at Custom Configuration.

Icon info.png Notice: Since ZK Ckeditor is a Java wrapper of js CKEditor, the installed plugins just work at the client-side and cannot be controlled in Java by default.


  1. Download Line Height plugin
  2. its js files under
  3. setup in your custom config js
CKEDITOR.editorConfig = function(config) {
     config.extraPlugins = 'lineheight';

Work with ZK6 MVVM

Icon info.png Notice: Since Ckeditor, we have added data binding annotation into the lang-addon.xml file, so you no more need to add the settings below.

Since 6.0.0

For work with ZK6 MVVM, it is required to create an addon XML and add the server annotation as follows:


<?xml version="1.0" encoding="UTF-8"?>
	<!-- The name of this addon. It must be unique -->
	<!-- Specifies what other addon this depends
	<!-- Which language this addon will be added to -->


then add it into WEB-INF/zk.xml


Supported Events

Event Type

Description: Denotes the content of an input component has been modified by the user.


Description: Denotes that user is changing the content of an input component. Notice that the component's content (at the server) won't be changed until onChange is received. Thus, you have to invoke the getValue method in the InputEvent class to retrieve the temporary value.


Description: Denotes the save button of the CKEditor component has been clicked by the user.

Supported Children


Use Cases

Version Description Example Location

Version History

Last Update : 2022/07/08

Version Date Content

Last Update : 2022/07/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.