-
1. Re: Rich:editor not showing on ajax reload
jprats Jun 21, 2012 4:01 AM (in response to jprats)1 of 1 people found this helpfulAfter some investigation I found the problem appears when ckeditor tries to load its own resources.
For example, it looks for:
{contextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.2.Final/Packed/org.richfaces.ckeditor/skins/v2/skin.js?t=B7U9
while the correct path is:
{contextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.ckeditor/skins/v2/skin.js?t=B7U9
A simple solution is to manually include a global javascript variable on the page, which tells ckeditor where to find its resources:
<script type="text/javascript"> window.CKEDITOR_BASEPATH = '#{request.contextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.ckeditor/'; </script>
That line should be included by the <rich:editor> itself, but for some reason it's not working properly when doing an ajax update.
This solution works fine for switchType=ajax, client or server.
-
2. Re: Rich:editor not showing on ajax reload
strannik Aug 26, 2012 4:55 PM (in response to jprats)Hi, Juan.
I encountered more weird behavior. My rich:editor is not loading even if it is placed outside of the tabPanel.
The requested resource cannot be found. Even if I apply your fix and path has changed the resource is still unavailable.
{contextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.ckeditor/skins/richfaces/editor.ecss?db=eAG7ZOn5HQAFgAJM
Showcase smaple works properly and path is similar.
-
3. Re: Rich:editor not showing on ajax reload
strannik Aug 27, 2012 2:51 AM (in response to strannik)I performed small investigation and added rich:editor component to Spring Booking RichFaces demo application.
The editor is not loading as well. I see two resources below not found.
{contextPath}/swf-booking-richfaces/org.richfaces.resources/javax.faces.resource/org.richfaces.ckeditor/lang/en.js?t=B7U9
{contextPath}/swf-booking-richfaces/org.richfaces.resources/javax.faces.resource/org.richfaces.ckeditor/skins/richfaces/editor.ecss?db=eAETZsyWAwABRwCe
What is ridiculous the same links work properly for showcase application
So it looks like configuration issue. Any suggestions?
-
4. Re: Rich:editor not showing on ajax reload
tungtrum17 Aug 27, 2012 4:53 AM (in response to jprats)You may be referenced at : https://community.jboss.org/message/752483#752483
-
5. Re: Rich:editor not showing on ajax reload
strannik Aug 27, 2012 7:19 AM (in response to tungtrum17)Thanks, nguyen.
I tried the solution suggested by Brendan but it didn't work. rich:editor was not loading.
However after few attempts I figured out that if I copy /ckeditor/ into my application and add the following lines
<h:head>
<script type="text/javascript" src="/ckeditor/ckeditor.js"/>
<script type="text/javascript" src="/ckeditor/adapters/jquery.js"/>
</h:head>
even <rich:editor /> line works properly. I needed to copy richfaces folder from RF jar into skins folder additionally.
However skins are completely missing. I guess it happened because skins were defined as EL expression like #{richSkin.panelBorderColor}
and is not processed in js file.
Is it possible to troubleshoot that?
One more thing I didn't understand from Brendan. Doesn't rich:editor work now? The sample at showscase.richfaces.org works ok. How can it be?
-
6. Re: Rich:editor not showing on ajax reload
rutlucas Mar 8, 2013 8:07 AM (in response to jprats)Hi,
I've experimented same issue with RF 3.4.1.Final and a design like this from a ui:include:
<a4j:outputPanel id="main-panel">
<h:form>
<h:outputText value="Folder" rendered="#{panel.view == 'folder'}" />
<h:outputText value="Binary" rendered="#{panel.view == 'binary'}" />
<rich:tabPanel switchType="ajax" rendered="#{panel.view == 'text'}" >
<rich:tab>
<f:facet name="header">
#{panel.selected.textContent.id}
<a4j:status name="panelUpdateStatus">
<f:facet name="start">
(Updating)
</f:facet>
</a4j:status>
</f:facet>
<a4j:outputPanel name="previewStatus">
<h:outputText escape="false" value="#{panel.selected.text}" />
</a4j:outputPanel>
</rich:tab>
<rich:tab header="Edit">
<rich:editor id="editor" toolbar="full" value="#{panel.selected.text}" >
<a4j:ajax event="change" render="panel" status="panelUpdateStatus" />
<a4j:ajax event="dirty" render="panel" status="panelUpdateStatus">
<a4j:attachQueue requestDelay="1000" />
</a4j:ajax>
</rich:editor>
</rich:tab>
</rich:tabPanel>
</h:form>
</a4j:outputPanel>
After use
<script>
window.CKEDITOR_BASEPATH = '#{request.contextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces.ckeditor/';
</script>
from the parent page it worked and resolved my issue.
Thanks for sharing !