In trying to get the RichFaces 4 Showcase to work in a portlet I've encountered a JS
problem with Require that I'm hoping someone may have some thoughts on.
The showcase has a JSF tag which defines a series of JSF Resource Dependencies which are
JS files, such as jquery.js, xregexp.js, shCore.js, etc.
These are resolved by JSF and Portlet Bridge to be Portlet Resource URLs and the JS files
are retrieved into the Browser as expected.
The problem is that the code in some of these JS files has the following:
typeof(require) != 'undefined' ? SyntaxHighlighter =
require('shCore').SyntaxHighlighter : null;
which calls Require from GateIn to resolve the dependency. The GateIn Require code then
looks for ./shCore.js and is unable to find it and throws errors to the JS console and
pops up an alert.
Is there a way to "link" the name used within Require for a module to a portlet
resource URL that was already served?
In theory I can create a gatein-resource.xml file that defines the location of the shCore
module in relation to the web app, but without any changes that would result in GateIn
loading shCore.js directly as well as JSF serving the same file under a different URL.
Thoughts?
Thanks
Ken
Show replies by date