1 Reply Latest reply on Jan 6, 2015 5:20 AM by Michal Petrov

    Richfaces 4.5.x doesn't support dynamic loading bundled javascript.

    Wang Liyu Apprentice


      I have Richface 4.5.1 + JSF 2.2.9 + WELD 2.2.8 application, everything works fine, only thing is in the app, we use normal HTTP GET to start a business process, and during the process it using a4j:jsFunction to call action and navigate to new page, and in one process, the second page (result page) is trying to show the chart, and if I don't put <richf:chart/> in the normal GET page, the required js function won't be load and in the JS console, it shows missing some JS resources (for example: jquery.flot.js), all these missing js are defined in the org.richfaces.renderkit.ChartRenderer classes, so I checked the generated page, it will actually load the separeted js in the normal GET response, but not load in the ajax response.


      Is there a way to work around this? I mean other than I put <rich:chart/> in the top page? most my process doesn't use the chart lib.



      Thanks a lot.

        • 1. Re: Richfaces 4.5.x doesn't support dynamic loading bundled javascript.
          Michal Petrov Master



          this is the way it works, JSF reads the page and loads resources for the components it finds there, no component - no resources.


          So if you need a particular library you either have to include the component associated with the library or you can include the library manually, e.g.

          <h:outputScript library="flot" name="jquery.flot.js" target="head" />


          Although I don't understand what you're trying to do, if you're not working with charts on the first page then you shouldn't need flot.