Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.7DR#3
-
Component/s: Framework, ICE-Components
-
Labels:None
-
Environment:portal portlet
Description
Some components require 3rd party JavaScript libraries to be available to function properly. Current examples would be the Rich Text Editor (based on FCKEdit) and GMap (Google Maps) components. At the moment, we inject these additional scripts using techniques that enhance the <head>. However, in a portlet environment, the code path that does this injection is not executed. With ICEfaces, portlets are treated as page fragments and so the logic for enhancing the <head> is never run.
I did notice in the NormalModeSerializer the following snippet:
if (isFragment(requestMap)) {
{ log.debug("treating request as a fragment"); }if (log.isDebugEnabled())
Node body = DOMUtils.getChildByNodeName(
{ //insert a containing element for bridge anchoring writer.write("<div>\n"); //We need to include, for now, ICE_EXTRAS all the time to //ensure that it is available. writer.write(makeScriptEntry(JavascriptContext.ICE_BRIDGE)); writer.write(makeScriptEntry(JavascriptContext.ICE_EXTRAS)); writer.write(DOMUtils.childrenToString(body)); writer.write("</div>\n"); }document.getDocumentElement(), "body");
if (null != body)
This does get run in portlets (which are basically treated as fragments). So I added this:
String[] jsLibs = JavascriptContext.getIncludedLibs(context);
{ String jsLib = jsLibs[i]; writer.write(makeScriptEntry(jsLib)); }for (int i = 0; i < jsLibs.length; i++)
Which seemed to get the Google components working as that is how they add the script library. But our Rich Text Component seems to do something else (not using the JavaScriptContext).