How do I use a custom CKEditor in a jsf page ? I'm having lots of trouble trying to implement it. What I did:
- I made a custom CKEditor with the ckEditor builder
- Downloaded and placed it in my webcontent folder.
test.xhtml page:
<script src="/ckeditor/ckeditor.js"></script>
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80"/>
<script>
CKEDITOR.replace( 'editor1');
</script>
</form>
Not working, just had a standard textarea. So I changed the src to:
<script src="ckeditor/ckeditor.js"></script>
It's was working but it wasn't my custom CKEditor build it was the vanilla one.
So I used the h:OutputScript tag. (I had 2 ckEditor folders in the same project to facilitate access while testing):
<h:outputScript library="script/ckeditor" name="ckeditor.js"></h:outputScript>
The textarea just disappears. My textarea just disappears. It finds the script because if I put a wrong script name my textarea is back up.
So I deleted the CKeditor folders... And there the magic happenned: It was still working when using this :
<script src="ckeditor/ckeditor.js"></script>
I had zero ckeditor.js file in my project and yet the script was working.
Then I tried the primefaces extension with this in pom.xml:
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>3.1.0</version>
</dependency>
and this in xhtml:
<pe:ckEditor id="editor" value="" checkDirtyInterval="0">
</pe:ckEditor>
But the result was the standard html textarea box again. How can I use it ?