Solving problems with CKEditor in 9.0.1FP1 and/or FP2

// Java code to define a map containing some configuration strings for the Dojo stuff
package org.openntf.xsp.dojo;
import java.util.HashMap;
import java.util.Map;
public class Config implements Serializable {
	private static final long serialVersionUID = -5429830701050906773L;
	private final Map<String, String> config;
	public Config() {
		this.config = new HashMap<String, String>();
		DojoLibrary dojolib =;
		// get the current version of Dojo
		config.put("version", dojolib.getVersion().toString());
		// get the keyword for setting toolbar options
		config.put("toolbartype", dojolib.getVersion().toString().indexOf("1.9") == -1 ? "toolbarType" : "toolbar");
		// to be extended...
	public Map<String, String> getConfig() {
		return config;
<!-- faces-config.xml -->
<!-- example using the Richtext control -->
<xp:inputRichText id="inputRichText1"
						<xp:dojoAttribute name="extraPlugins"
						<xp:dojoAttribute value="Full">

How it works

The bean stores some values in a config map. The map value of "toolbartype" stores whether to use "toolbarType" or "toolbar" as attribute name for the control. So in this case it computes the attribute name and not it's value (in this case I use the "Full" toolbar with all options).

I tried to compute the attribute name directly with the above Java code but it failed. I think the rendering phase cannot compute the correct version until the control is rendered itself so the bean solution was the alternative as it is instanciated before any rendering takes place.

Oliver Busse
August 31, 2014 3:19 PM

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.

No comments yetLogin first to comment...