Cannot read property clearCustomData of null CKEditor 2.0 RC

Community Driven Extensions Project
Post Reply
Tiny
Posts: 79
Joined: 03 Jul 2013, 17:40

19 Apr 2014, 08:02

I have upgraded PrimeFaces to 5.0 RC1 and PrimeFaces Extensions to 2.0.0 RC. I'm using resources-ckeditor-2.0.0.RC.

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>

And the managed bean in question is as follows.

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.");
    }
}

The listener method of <p:commandButton> is invoked, when it is clicked but on the developer tool of Google Chrome, the following error is reported after the version is updated.

This did not happen in the previous versions that I was using, PrimeFaces Extensions 1.1.0 and PrimeFaces 4.0 final.
CKEditor throwed a error while destroying the old instance: TypeError: Cannot read property 'clearCustomData' of null
This causes the action of <p:commandButton> to prevent from being completed in its entirely.

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?
PF 6.0, PF Ext 6.0.0, Mojarra 2.2.13, OmniFaces 2.5
Java EE 7, JAAS, EJB 3.2
Spring 4.0 GA, Spring Security 3.2.0 GA, Struts 2.3.16
EclipseLink 2.6.3 (JPA 2.1), Hibernate 5.2.1 (JPA 2.1)
GlassFish 4.1, WildFly 10.0.0, Tomcat 8.0.29
NetBeans 8.1, JDK 8u66

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

19 Apr 2014, 08:35

Hmm please create an issue.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Tiny
Posts: 79
Joined: 03 Jul 2013, 17:40

21 Apr 2014, 15:21

PF 6.0, PF Ext 6.0.0, Mojarra 2.2.13, OmniFaces 2.5
Java EE 7, JAAS, EJB 3.2
Spring 4.0 GA, Spring Security 3.2.0 GA, Struts 2.3.16
EclipseLink 2.6.3 (JPA 2.1), Hibernate 5.2.1 (JPA 2.1)
GlassFish 4.1, WildFly 10.0.0, Tomcat 8.0.29
NetBeans 8.1, JDK 8u66

Mathieu-Castets
Posts: 45
Joined: 03 Jul 2014, 19:04
Location: Biarritz, France

03 Jul 2014, 19:08

Hey I got the same issue so I have posted a temporary workaround on the above link:

Just add

Code: Select all

onsuccess="PF('yourCKEditorWidgetVar').destroy()"
to your commandButton
PrimeFaces 5.3 - PF Extensions 4.0.0 - OmniFaces 2.2 - Mojara 2.2.12 - GlassFish 4.1.1 - Java 7 - Netbeans 8.1

Tiny
Posts: 79
Joined: 03 Jul 2013, 17:40

06 Sep 2014, 07:29

PF 6.0, PF Ext 6.0.0, Mojarra 2.2.13, OmniFaces 2.5
Java EE 7, JAAS, EJB 3.2
Spring 4.0 GA, Spring Security 3.2.0 GA, Struts 2.3.16
EclipseLink 2.6.3 (JPA 2.1), Hibernate 5.2.1 (JPA 2.1)
GlassFish 4.1, WildFly 10.0.0, Tomcat 8.0.29
NetBeans 8.1, JDK 8u66

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests