Hi,

The following classes use javascriptLocation. However they never prefix the emitted URL with the context path:
 * HtmlAccordionPanelRenderer
 * InputSuggestAjaxRenderer
 * EffectRenderer
 * AutoUpdateDataTableRenderer
 * HtmlTreeRenderer
 * InputSuggestRenderer
 * HtmlJSCookMenuRenderer
I would expect that at least 99% of the time the javascript *will* be bundled with the webapp. So how are people expected to use javascriptLocation in this case? Like this perhaps?
  <t:HtmlTreeRenderer javascriptLocation=
    "#{facesContext.externalContext.contextPath}/myjs"
  .../>
If so this is rather ugly and clumsy. Perhaps some better mechanism could be introduced to handle this? Perhaps some custom "protocol" like "local:/myjs" could be used to indicate that "{contextpath}/myjs" should be used? I haven't checked but presume that imageLocation/styleLocation don't currently get the context path prepended either. I think a check for such a custom URL protocol could simply go in the AddResources class.


I also have noticed that HtmlTreeRenderer manually generates its own <script src="..."> tag rather than using the AddResource methods. Perhaps this should be cleaned up? I can't see any reason for doing this.


Regards,

Simon

Reply via email to