6 Replies Latest reply on Nov 14, 2008 1:28 PM by Nick Belaevski

    Prototype.js loaded twice

    josef adamcik Newbie

      When I use <a4j:loadScript src="resource://prototype.js" /> (mentioned in demo application http://livedemo.exadel.com/richfaces-demo/richfaces/script.jsf?c=loadScript&tab=usage) and some component loads Prototype too, it results in two different script urls

      /a4j/g/3_2_2.GAorg.ajax4jsf.javascript.PrototypeScript.faces
      and
      a4j/g/3_2_2.GAprototype.js.faces
      

      -> script is loaded twice.

      Commonly it doesn't cause problem, but sometimes it can broke prototype in IE 6 (not tested other versions). There was problem with suggestion box throwing errors on some methods from script.aculo.us in my case.

      I can solve problem by removing global a4j:load from my templates (I use it mainly to make sure prototype is loaded everywhere), but I think it's bug -> both ways (comopenent loading and a4j:loadScript) should generate same resource url so richfaces can detect that script is already included.

      Should I fill jira issue? :)

      Richfaces version: 3.2.2GA