2 Replies Latest reply on Nov 13, 2010 4:13 PM by gfernandes

    Picklist returns "element is null" JS error

    gfernandes

      Hi there.

       

      I need some help here: I try to put a rich:pickList in my application, but Firebug keeps shouting me "element is null" (a js error) when the page is loaded. Then, nothing from pickList works: I cant select any of the items and the buttons do nothing.

       

      It points to 2 lines in a file from richfaces:

       

      3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript.xhtml line 251

       

      and

       

      3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript.xhtml line 265

       

      Btw, I´ve even tried to put an empty richList like this

       

      <rich:pickList>

      </rich:pickList>

       

      and also a pickList exactly as the example shown in Exadel Live Demo, but none of these got to work.

       

      Any clue?

       

      TIA

        • 1. Re: Picklist returns "element is null" JS error
          ilya_shaikovsky

          I mean you trying to use external js libraries on the page. E.g. if you using jQuery you should:

          • use RF bundled version
          • use jQuery().call() instead of $().call as it conflicts with prototype.

          The same for prototype. If you trying to load some external version - it could conflict with bundled.

          • 2. Re: Picklist returns "element is null" JS error
            gfernandes

            Thanks for your message.

             

            It was really a js script file that I included in my template xhtml (thats why it got so difficult to figure out where the error was).

             

            I was overloading the operator $ using function $(id) {return document.getElementById(id);}, but or JQuery or Prototype (which is used by RF) already do that.

             

            Tks again.