Primefaces-extensions ckeditor - 缺少工具栏
Primefaces-extensions ckeditor - missing toolbar
我正在尝试在我的 JSF 应用程序中使用 primefaces 扩展 ckEditor
,如 here 所述。我将依赖项添加到 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>
我正在尝试在我的 JSF 应用程序中使用 primefaces 扩展 ckEditor
,如 here 所述。我将依赖项添加到 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>