This content has been marked as final.
Show 2 replies
-
1. Re: a4j:loadScript and a4j:support problem
pbaker01 Nov 30, 2008 11:03 AM (in response to oni_ffm)Hi,
If the script is not loaded in a jar you may want to just reference the file using the context relative path. The code below works for me:
(be sure to include the leading slash)<ui:composition template="#{wabState.layout}"> <ui:define name="header"> <a4j:loadScript src="/js/Focus.js?version=5" /> </ui:define>
From the documentation:
http://livedemo.exadel.com/richfaces-demo/richfaces/script.jsf;jsessionid=71C330B2644114E176A05258ED885E44?c=loadScript&tab=usage
a4j:loadScript is similar to the standard script tag with src attribute, but it allows to load script from alternative sources like a jar file.
src attribute defines the context relative path to the script. Instead of html script tag it's not required to have a prefix of your application. The leading slash in the path means the root of the web context.
You can use "resource://" prefix to access the script file using RichFaces resource framework. For example, if your script file is located inside the jar file and has a full path there: /org/mycompany/assets/script/focus.js , you can point to it with:
<a4j:loadScript src="resource:///org/mycompany/assets/script/focus.js" /> -
2. Re: a4j:loadScript and a4j:support problem
nbelaevski Dec 1, 2008 9:52 AM (in response to oni_ffm)Hi,
Try to remove resource:/// prefix