-
1. Re: rich:editor no display when load with ajax
healeyb Aug 1, 2012 10:37 PM (in response to tungtrum17)I hit the same problem. There is an underlying problem with ckeditor and I don't see an easy fix. I've got it working though
and tomorrow I'll tell you how (it's late for me now).
Regards,
Brendan.
-
2. Re: rich:editor no display when load with ajax
tungtrum17 Aug 1, 2012 11:49 PM (in response to healeyb)Thanks for your support...
I am waiting...
-
3. Re: rich:editor no display when load with ajax
healeyb Aug 27, 2012 5:28 AM (in response to tungtrum17)The solution I'm using is to use ckeditor directly, it can be downloaded here: http://ckeditor.com/download.
Then I install it so that I have a folder (in a maven project) src/main/webapp/ckeditor. What you don't want is this resource
to be served by facesservlet, I'm not sure why but I couldn't get it to work. In this example I have a property in a backing bean
String emailContent, and when I click on the Send Email button note the contents of the onclick handler which is necessary.
<h:head>
<script type="text/javascript" src="/ckeditor/ckeditor.js"/>
<script type="text/javascript" src="/ckeditor/adapters/jquery.js"/>
</h:head>
<h:body>
<h:form prependId="false">
<h:inputHidden id="emailHidden" value="#{beanParam.emailContent}"/>
<textarea id="emailContent" name="emailContent"/>
<script type="text/javascript">
if(CKEDITOR.instances["emailContent"]) {
delete CKEDITOR.instances["emailContent"];
}
jQuery('#emailContent').ckeditor(function() {}, {
toolbar: 'MyToolbar'
});
</script>
<a4j:commandButton id="sendButton" onclick="jQuery('#emailHidden').val(jQuery('#emailContent').val())" action="..."/>
</h:form>
</h:body>
The alternative to this would be to add the workaround:
if(CKEDITOR.instances["emailContent"]) {
delete CKEDITOR.instances["emailContent"];
}
into the javascript file that ships with richfaces, whatever that may be.
Regards,
Brendan.
-
4. Re: rich:editor no display when load with ajax
tungtrum17 Aug 8, 2012 12:13 AM (in response to healeyb)thanks Brendan