Programatically used HtmlLoadScript and HtmlLoadStyle is not rendered anymore
-----------------------------------------------------------------------------

                 Key: RF-4014
                 URL: https://jira.jboss.org/jira/browse/RF-4014
             Project: RichFaces
          Issue Type: Bug
    Affects Versions: 3.2.2
         Environment: Tomcat 6.0.16
MyFaces 1.2.3
Tomahawk 1.1.17 Snapshot
Facelets 1.1.15 Snapshot
Richfaces 3.2.2 Snahshot (20080724)

            Reporter: Jan Ziegler


I have a custom JSF component which has a renderer that includes some javascipt 
files and css programmatically by using HtmlLoadScript and HtmlLoadStyle. This 
was no problem with the early snapshots of 3.2.2 and before but now it's not 
working anymore. Nothing gets rendered / included. Here's how I use 
HtmlLoadScript in the renderer's code:

Code:

public void encodeBegin(FacesContext fc, UIComponent component)
{
        ...
        UIResource loadScript = new HtmlLoadScript();
        loadScript.setId(fc.getViewRoot().createUniqueId());
        
loadScript.setSrc("resource:///org/richfaces/renderkit/html/scripts/jquery/jquery.js");
  // or any other js
        component.getChildren().add(loadScript);
        ...
}
        

The same problem is with css including by HtmlLoadStyle.

If I use <a4j:script> or <a4j:style> directly on the xhtml-page there's no 
problem. but I want the component or better the component's renderer to handle 
this.

I realized on thing - maybe this helps for debugging: the javascript and css 
files ARE included when I do a "reRender" with my custom component triggert by 
some ajax action. Then everthing is fine and the ajax reponse contains the 
javascipt and css references but it's not a solution to first reRender each 
component of course. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to