ckeditor: toggle button in facelets
- by Shilpa
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