I have a CKEditor which is updated (actually the container panel of the editor is updated via AJAX), when <p:commandButton> is pressed. The sample code is as shown below.
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:pe="http://primefaces.org/ui/extensions">
<h:head>
<title>Test</title>
</h:head>
<h:body>
<h:form id="form" prependId="true">
<p:panel id="aboutUsPanel">
<pe:ckEditor value="#{testManagedBean.editorContents}" label="About us" height="200" width="1000"/>
<p:commandButton actionListener="#{testManagedBean.actionListener}" value="#{messages['button.save']}" update="aboutUsPanel"/>
</p:panel>
</h:form>
</h:body>
</html>
Code: Select all
@ManagedBean
@ViewScoped
public final class TestManagedBean implements Serializable
{
private static final long serialVersionUID = 1L;
private String editorContents;
public String getEditorContents() {
return editorContents;
}
public void setEditorContents(String editorContents) {
this.editorContents = editorContents;
}
public void actionListener() {
System.out.println("actionListener() called.");
}
}
This did not happen in the previous versions that I was using, PrimeFaces Extensions 1.1.0 and PrimeFaces 4.0 final.
This causes the action of <p:commandButton> to prevent from being completed in its entirely.CKEditor throwed a error while destroying the old instance: TypeError: Cannot read property 'clearCustomData' of null
In reality, I'm using a <pe:blockUI> to block a CKEditor, when an action is triggered (when a button or link is clicked, for example). The blocked area occupied by CKEditor is never unblocked once blocked by triggering an action due to this error.
Is there something new in the new version that I need to adopt to make a CKEditor work properly?