1 Reply Latest reply on May 10, 2013 2:53 AM by jigg4

    Possible Reasons for "ReferenceError: jsf is not defined"


      Hello everyone,


      I am trying to run a simple webpage with a simple RichFaces component and i get the following error: "ReferenceError: jsf is not defined".

      The component which I am using to test whether richfaces is working or not is : rich:select enableManualInput="true". The weird part is, that the component is actually working, but firebug is still telling me that i have the told error!

      I am running tomcat 7, myfaces and latest RichFaces version. I have also added sac 1.3, cssparser and guava 10.0.1.

      Which reasons can this kind of error have?


      My simple page:


      <html xmlns="http://www.w3.org/1999/xhtml"
          <title>RichFaces Test</title>
              <rich:select enableManualInput="true"
                  defaultLabel="start typing for select">
                  <f:selectItem itemValue="0" itemLabel="Berlin" />
                  <f:selectItem itemValue="1" itemLabel="Berge" />
                  <f:selectItem itemValue="2" itemLabel="London" />
                  <f:selectItem itemValue="3" itemLabel="Moskau" />
                  <f:selectItem itemValue="4" itemLabel="Long Island" />
                  <f:selectItem itemValue="4" itemLabel="Bering" />
                  <f:selectItem itemValue="4" itemLabel="Loehne" />
        • 1. Re: Possible Reasons for "ReferenceError: jsf is not defined"

          Ok I watched into my header in firebug of the generated site and found this two JavaScripts:

          1) jsf.js.faces?ln=javax.faces&stage=Development

          2) jsf.js.faces?ln=org.apache.myfaces.core.api


          After 2) i can see all the richfaces JS. So actually 1) and 2) should be loaded before the richfaces JS?

          After setting breakpoints in 2) on line 40 where it says: var jsf = new function() {.......

          And also a breakpoint in the richfaces-queue.js.faces, where the jsf function is used, i noticed that the richfaces-queue.js.faces is loaded BEFORE the jsf.js, which doesnt make any sense to me.

          Any ideas why this is happening guys?




          EDI: I have solved this issue by editing a param in my web.xml:







          This one was set to true, which caused the above errors. By setting it to false solves the issue, just in case anybody runs into the same problem