ckeditor: toggle button in facelets
Posted
by
Shilpa
on Stack Overflow
See other posts from Stack Overflow
or by Shilpa
Published on 2012-10-24T04:56:48Z
Indexed on
2012/10/24
5:00 UTC
Read the original article
Hit count: 415
I am trying to toggle between CKEditor and textarea in a facelet(.xhtml) file. I have used the same code in a jsp file and it works fine. But in .xhtml file its not doing the toggle between ckeditor and plain editor.It loads ckeditor both the times.Can anyone please let me know what am I missing.
Code of xhtml file:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ckeditor="http://ckeditor.com">
<head>
<title>Welcome PAge</title>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="ckeditor/adapters/jquery.js"></script>
<script type="text/javascript" src="ckeditor/config.js"></script>
</head>
<body>
<div>Welcome Page!!</div>
<h:form>
<center><p><h:outputText value="#{userBean.username} logged in"/></p></center>
<center> <p> Questions:
<h:inputTextarea id="editor1" class="ckeditor" rows="20" cols="75" /> <br></br> </p> </center>
<h:commandButton value="Ckeditor" onclick="ckeditor.replace('editor1');" />
<h:commandButton value="Text editor" onclick="ckeditor.instances.editor1.destroy();" />
<h:commandButton value="Get Data" onclick="alert(ckeditor.instances.editor1.getData());" />
<br></br> <br></br>
</h:form>
</body>
</html>
Thanks in advance, Shilpa
© Stack Overflow or respective owner