jsf - h:outputScript with target="head" not working with Primefaces 3.5 -


i have jsf application scripts inserted using target="head" attribute, after including primefaces 3.5 classpath, these scripts stop rendering.

here page code:

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"        xmlns:ui="http://java.sun.com/jsf/facelets"        xmlns:h="http://java.sun.com/jsf/html"        xmlns:f="http://java.sun.com/jsf/core">  <h:head>   </h:head>    <h:body>        <h:outputscript  target="head">           function a(){};         </h:outputscript>  </h:body> </html> 

removing target attribute renders script ok, in body, not in head...

any clues? & regards.

since primefaces 3.0, there new headrenderer allows customizable resource ordering. see this blog. has overriden standard jsf head renderer. @ own okay, apparently failed recognize inline scripts target of head. bug in primefaces head renderer. best bet report issue pf guys.

in meanwhile, if aren't making use of new primefaces feature @ all, put mojarra's own headrenderer default head renderer adding following entry faces-config.xml:

<render-kit>     <renderer>         <component-family>javax.faces.output</component-family>         <renderer-type>javax.faces.head</renderer-type>         <renderer-class>com.sun.faces.renderkit.html_basic.headrenderer</renderer-class>     </renderer> </render-kit> 

note: in case you're using myfaces instead of mojarra, reference myfaces own 1 instead.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -