[英]Primefaces-extensions ckeditor - missing toolbar
我试图使用primefaces的扩展ckEditor
在我的JSF应用程序,如所描述这里。 我将依赖项添加到我的pom.xml
:
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>4.0.0</version>
</dependency>
这就是我的观点:
<p:growl id="editorgrowl" showDetail="true" />
<pe:ckEditor id="editor" value="#{mbEditorController.content}"
toolbar="[['Cut','Copy','Paste','PasteText','PasteFromWord','-', 'SpellChecker', 'Scayt']]">
<p:ajax event="save"
listener="#{mbEditorController.saveListener}"
update="editorgrowl" />
</pe:ckEditor>
这是控制器(托管 bean):
@ManagedBean(name = "mbEditorController")
@ViewScoped
public class EditorView implements Serializable {
private static final long serialVersionUID = 6822767317343704211L;
private String content;
private String secondContent;
public EditorView() {
content = "Type in your text here...";
secondContent = "This is a second editor";
}
public void saveListener() {
content = content.replaceAll("\\r|\\n", "");
final FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Content",
content.length() > 150 ? content.substring(0, 100) : content);
FacesContext.getCurrentInstance().addMessage(null, msg);
}
public void secondSaveListener() {
secondContent = secondContent.replaceAll("\\r|\\n", "");
final FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Second Content",
secondContent.length() > 150 ? secondContent.substring(0, 100) : secondContent);
FacesContext.getCurrentInstance().addMessage(null, msg);
}
// getters, setters
}
不幸的是,我看不到工具栏,而只是一个文本输入区域,如下面的屏幕截图所示:
更新
我的控制台中有一个 javascript 错误:
http://localhost:8080/MyApp/javax.faces.resource/ckeditor/ckeditor.js.xhtml?ln=primefaces-extensions&v=4.0.0 Failed to load resource: the server responded with a status of 404 (Not Found)
什么可能导致问题? 我错过了什么吗?
添加以下依赖项:
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>resources-ckeditor</artifactId>
<version>4.0.0</version>
</dependency>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.