Why is pe:ckEditor not working with PrimeFaces 6?

Community Driven Extensions Project
Post Reply
RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

23 Dec 2016, 17:42

In the past, I experimented with pe:ckEditor and had no issues displaying the editor and experimenting with its features. Since my original test, I have upgraded my PrimeFaces version serveral times and am now using PrimeFaces 6.0.11. I have not updated my PrimeFaces Extension version or retested pe:ckEditor until this morning.

This morning I decided to see if pe:ckEditor would work better for me than p:editor and p:textEditor, so I updated my dependencies to the current versions as show below.

Code: Select all

<dependency>
	<groupId>org.primefaces.extensions</groupId>
	<artifactId>primefaces-extensions</artifactId>
	<version>6.0.0</version>
</dependency>
<dependency>
	<groupId>org.primefaces.extensions</groupId>
	<artifactId>resources-ckeditor</artifactId>
	<version>6.0.0</version>
</dependency>
Unfortunately, I received the following error in Chrome when I displayed my dialog containing the editor:
  • Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. send @ jquery.js.xhtml?ln=primefaces&v=6.0&v=6.0:25 primefaces-extensions.source.js:701
As a test, I tried different combinations of PrimeFaces and PrimeFaces Extensions with the following results:

PF 5.3 with PFE 3.2.0

This combination worked as expected.

PF 5.3 with PFE 4.0.0

This combination worked as expected.

PF 5.3 with PFE 6.0.0

This combination did not work and threw the following error in Chrome:
  • CKEditor throwed a error while destroying the old instance: TypeError: Cannot read property 'destroy' of undefined primefaces-extensions.source.js:17
    Uncaught TypeError: Cannot read property 'charAt' of undefined 1.1.1.1. at Object.isExtensionMapping (primefaces-extensions.source.js:17)
    at Object.CKEDITOR_GETURL (primefaces-extensions.source.js:568)
    at Object.window.CKEDITOR.window.CKEDITOR.e.getUrl (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:8:201)
    at e (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:458:401)
    at b (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:458:483)
    at Object.loadPart (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:460:300)
    at l (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:237:220)
    at a.eval (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:237:82)
    at a.i (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:10:222)
    at a.CKEDITOR.event.CKEDITOR.event.fire (eval at <anonymous> (jquery.js.xhtml?ln=primefaces&v=5.3&v=5.3:14), <anonymous>:12:47)
PF 6.0 with PFE 4.0.0

This combination did not work but did not throw any errors in the Chrome console. The displayed dialog only showed an empty textarea.

Why does pe:ckEditor work for me with PF 5.3 and PFE 4.0.0 but not with PF 6.0 and PFE 6.0.0?

Thanks!
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

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

23 Dec 2016, 20:13

no idea sry but 6.0 and 6.0 is working fine in the showcase. http://www.primefaces.org/showcase-ext/ ... cUsage.jsf
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

RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

24 Dec 2016, 02:27

I believe that the multiple versions appended at the end of the error messages is giving me a clue. For example, one of my error messages reports the following:
I would have expected a single &v=6.0.0.

When I deploy using PF 6.0.12 and PFE 6.0.0, the Chrome Sources tab reports the following:

Code: Select all

javax.faces.resources
    ckeditor
        skins/mono
            &v=6.0.0&v=6.0.12&v=6.0.12
        config.js.xhtml?ln=primefaces-extensions&v=6.0.0&v=6.0.12
When I deploy using combination that works such as PF 5.3 and PFE 4.0.0, the Chrome Sources tab reports the following:

Code: Select all

javax.faces.resources
    ckeditor
        skins/mono
            editor.css.xhtml?ln=primefaces-extensions&v=4.0.0
            icons.png.xhtml&ln=primefaces-extensions&v=4.0.0
        config.js.xhtml?ln=primefaces-extensions&v=4.0.0
Why is the PF 6.0.12 and PFE 6.0.0 combination appending multiple versions to the URL?
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

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

24 Dec 2016, 11:48

does it work with PF 6.0 instead 6.0.12?
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

RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

24 Dec 2016, 13:51

When I was testing the PF and PFE combinations, I specifically tested with PF 6.0 instead of PF 6.0.12. I could see the textarea display for a splt second and then go away. The Chrome console reported the following errors:
  • Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. send @ jquery.js.xhtml?ln=primefaces&v=6.0&v=6.0:25 primefaces-extensions.source.js:701
The only difference that I could see between the PF 6.0 and the PF 6.0.12 test is that the error messages contained &v-6.0.12 instead of &v=6.0.

Just to see what would happen, I tested PF 6.0.12 with PFE 6.0.0 but did not include the resources-ckeditor dependency in my maven pom file. After this test, Chrome reported the following errors:
  • Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
I find it interesting that the URL in the error messages only contains &v=6.0.0&v=6.0.12 when the previous error messages contained &v=6.0.0&v=6.0&v=6.0 in the PF 6.0 test and &v=6.0.0&v=6.0.12&v=6.0.12 in the PF 6.0.12 test.

I also stumbled across the following forum discussion that appears to be similar to my issue.
In the above forum discussion, 3vi stated that he had "Triplicate jar files on my classpath" and Oleg states "This explains three &v=0.5.0&v=0.5.0&v=0.5.0 in URL".

I'm using Eclipse with Maven to create an ear file that I deploy to Glassfish. How would I determine my classpath in this situation?
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

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

24 Dec 2016, 14:53

I would try to manually deploy the ear file and check the generated lib directories of the ear and war.
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

RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

24 Dec 2016, 15:35

I have the following two references to primefaces-6.0.12.jar in my deployed application:
  • ...\Domains\domain1\applications\elis-ea\lib\primefaces-6.0.12.jar
  • ...\Domains\domain1\applications\elis-ea\elis-wa-0.0.1-SNAPSHOT_war\WEB-INF\lib\primefaces-6.0.12.jar
I believe that this is a result of putting my PrimeFaces 6.0.12 dependency in the pom.xml file of my Parent project in Eclipse instead of the pom.xml in the web app project. I did this because use some of my EJBs use the PrimeFaces UploadedFile class and this allowed me to access the classes from my EJBs.

Could this be the problem?
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

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

24 Dec 2016, 17:16

maybe, yes. just try it.
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

RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

24 Dec 2016, 17:17

I removed my ejb project's dependency on primefaces and redeployed. After deploying, I only see a single reference to the PrimeFaces jar file in my web app as shown below.
  • ...\Domains\domain1\applications\elis-ea\elis-wa-0.0.1-SNAPSHOT_war\WEB-INF\lib\primefaces-6.0.12.jar
I am also now able to see the CKEditor when using PF 6.0.12 and PFE 6.0.0!!!!!

In summary, PFE 6.0.0 apparently does not like multiple references to the PF jar in the deployed application. This could be an issue if your EJB project really needs access to a PrimeFaces class. Would you consider this a bug in the PrimeFaces Extension?

Thank you for your help!
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

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

24 Dec 2016, 18:17

Nope sorry, multiple primefaces jars/versions could always lead to a weird behavior.
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

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests