voyent
inputRichText missing since beta 2  XML
Forum Index -> Development Build Feedback
Author Message
lafortunejm0

Joined: 13/May/2010 15:24:59
Messages: 9
Offline


Hi all,

Since I've updated to beta 2 my ice:inputRichText component either doesn't appear, or it appears but all of the toolbar icons are missing.

I've narrowed down the problem a bit. In the source code of the page, notice these scripts:

Code:
 <script src="/DiscourseUI/javax.faces.resource/inputrichtext/ckeditor/ckeditor.mapping.js.js" type="text/javascript"></script>
 
 <script src="/DiscourseUI/faces/javax.faces.resource/inputrichtext/ckeditor/ckeditor.js" type="text/javascript"></script>
 
 <script src="/DiscourseUI/faces/javax.faces.resource/inputrichtext/ckeditor_ext.js" type="text/javascript"></script>
 


The bottom two appear correct but the top one, after the application name, should have /faces/, and there should only be one ".js" extension at the end.

Does anyone know where I can look to fix this, maybe how that src value is generated?

Thanks,
John

ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1332
Offline


Hi,

There was a change to the way the ice:inputRichText resources are preloaded introduced in Beta2.

From the Release Notes:

ice:inputRichText

The CKeditor Javascript libraries required by the ice:inputRichText component are no longer automatically preloaded with every initial page render. Instead, the mandatoryResource configurations may be used to specify if the ice:inputRichText resources should be preloaded on the page.

There are two methods of configuring mandatoryResources; Application globally via the "mandatoryResourceConfiguration" context-parmeter in the web.xml file, or per-page via inclusion of an <icecore:config mandatoryResource="com.icesoft.faces.component.inputrichtext.InputRichText" /> tag on the page where the component is used.

This provides increased efficiency to page loading in cases where the ice:inputRichText is not used on a page.  


So you'll need to add the following tag to the top of your h:body section:

Code:
 <icecore:config mandatoryResource="com.icesoft.faces.component.inputrichtext.InputRichText" />
 

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
lafortunejm0

Joined: 13/May/2010 15:24:59
Messages: 9
Offline


Thanks for your quick response, Ken. I'm sorry but I forgot to mention I was already using the mandatoryResourceConfiguration parameter in web.xml with its value set to "all".

I've noticed that when I first load a page containing the component, it doesn't appear. If I do a refresh, it appears but all of the icons are missing. So somehow I do think it is related to the resources not being initially loaded.

- John
lafortunejm0

Joined: 13/May/2010 15:24:59
Messages: 9
Offline


Fixed by adding to web.xml:

Code:
 <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.js</url-pattern>
 </servlet-mapping>
 


nicola_spb

Joined: 11/Sep/2009 00:00:00
Messages: 6
Offline


Where are you take ckeditor.mapping.js.js ?

ICEFaces 2.1 BETA2

A have error and my inputRichText not rendered. Can you help me?

Code:
INFO: 12:50:51,987 ERROR [ResourceImpl:81] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@371516] was unable to create a resource for resourceName=[inputrichtext/ckeditor/ckeditor.mapping.js.js&p_p_col_count=1&p_p_col_id=column-1&p_p_id=WFTaskManager_WAR_WF_INSTANCE_L82y&p_p_lifecycle=2] libraryName=[null] contentType=[null]


Thanks.
lafortunejm0

Joined: 13/May/2010 15:24:59
Messages: 9
Offline


Does your page load without the component or does an error page show up?

I assume you are using the mandatoryResourceConfiguration parameter an tried passing the javacript through the faces servlet?

Can we please see the <script> declarations in the source code of your page?

nicola_spb

Joined: 11/Sep/2009 00:00:00
Messages: 6
Offline



Page load without the component inputRichText and I see the only error in log.

ckeditor.js and ckeditor_ext.js loaded, but ckeditor.mapping.js.js is not found (I could see this in generated html file). I saw in icefaces-compat.jar/META-INF/resources and couldn`t find this .js file.

My .xhtml
Code:
...
 <h:head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <title><ui:insert name="title">Default Title</ui:insert></title>
         <h:outputStylesheet library="css" name="workflow.css" target="head"/>
         <ice:outputStyle href="#{request.contextPath}#{styleBean.cssFilePath}"/>
     </h:head>
 ....
 



My web.xml
Code:
 <context-param>
         <param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
         <param-value>com.icesoft.faces.component.inputrichtext.InputRichText</param-value>
     </context-param>
lafortunejm0

Joined: 13/May/2010 15:24:59
Messages: 9
Offline


Yeah, it sounds like the same thing happened for both of us.

In the HTML source of my page, if I clicked on the script it would say not found. I noticed all the other scripts were going through the Faces Servlet.

Add this to your web.xml and it should be fixed:
Code:
 <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.js</url-pattern>
 </servlet-mapping>
 
nicola_spb

Joined: 11/Sep/2009 00:00:00
Messages: 6
Offline


I did try to do this but your solution don`t work for me.
I don`t know why :(

Maybe BETA 2 not stable and this will be fix in release.
mircea.toma

Joined: 10/Feb/2005 00:00:00
Messages: 323
Offline


The prefix/suffix issue was fixed post BETA 2. Actually, this discussion thread prompted us to search for it. The resource extension was not calculated properly when a prefix (/faces/*) servlet mapping was used.
See revision 26485 commit for http://jira.icefaces.org/browse/ICE-7444.
[Email]
nicola_spb

Joined: 11/Sep/2009 00:00:00
Messages: 6
Offline


Hi. Problem not resolved.

Know I try use Liferay 6.0.6 with ICEFaces3 RC1 but problem saved. May be bugs in PortletBridge !?
MichaelBreu

Joined: 17/Aug/2011 10:08:42
Messages: 13
Offline


Hello all,

I know, this thread is old, however I wanted to add the results of my investigations.

I have recently upgraded from iceFaces 3.2.0 to 3.3.0 and detected that richtTextEditor was not working any more.

The reason is that there are very weird javascript-Exceptions. Finally I have found that in ckeditor.mapping.js at the end is a weird piece of code:

[code]
if (r.indexOf('://') > -1) {
var i = document.location.href.lastIndexOf('/');
r = r.replace(/\?t=B1GG4Z6$/,'');

r = r.substring(i + 1);

};

for (var i = 0, l = mappings.length; i < l; i++) {
var m = mappings[i];
if (m.i == r) {
return m.o;
}
}

return false;
[/code]

r seems to hold various URLs, sometimes of the form "https://<host>/<contextRoot>/faces/javax.faces.resource/richtextentry/ckeditor/contents.css"

r.substring(i + 1) returns an randomly truncated result, because var i = document.location.href.lastIndexOf('/') is the last index of the loaded page e.g "https://<host>/<contextRoot>/faces/a/b/x/page.html".

I have patched my icefaces-ace.jar/.../ ckeditor.mapping.js with

[code]
var i = document.location.href.lastIndexOf('/');
r = r.replace(/\?t=B1GG4Z6$/,'');
// start befor Patch

// r = r.substring(i + 1);

// Patches to revive RichTextEditor!!
var rPath = 'javax.faces.resource/richtextentry/ckeditor/';
var i2 = r.indexOf(rPath);
if(i2 > -1) {
r = r.substring(i2 + rPath.length);
}
// end patch
};
[/code]

OK, for sure you could improve this further, however this works for me.

I was not able to check whether this also a problem in icefaces 4.x. because the demonstration site seems currently down.

Cheers and a merry christmas

Wallenstien
 
Forum Index -> Development Build Feedback
Go to:   
Powered by JForum 2.1.7ice © JForum Team