10 Replies Latest reply on May 3, 2011 3:51 AM by feuyeux

    How to find jquery version in richfaces

    sumathra

      1. What version of jquery is supported by richfaces(3.3.3.CR1).  When i gave $.fn.jquery in my Firebug Console Iam getting TypeError: Cannot read property 'jquery' of undefined. What does it mean?

       

      2. I loaded jquery.min.js in my page, the jquery script works fine but inplaceSelect in this page is not working properly oninputclick.

          <a:loadScript src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"/>

         How to get the inplaceSelect functionality back?

        • 1. Re: How to find jquery version in richfaces
          nbelaevski

          Hi Kalpana,

           

          1) '$' is used by prototype.js, use 'jQuery'

          2) You need to call jQuery.noConflict(), so that it won't conflict with prototype.js.

          1 of 1 people found this helpful
          • 2. Re: How to find jquery version in richfaces
            sumathra

            I used jQuery.noConflict(); after that prototype.js is working but loaded script is not.

            • 3. Re: How to find jquery version in richfaces
              nbelaevski

              Are you using 'jQuery' instead of '$'?

              • 4. Re: How to find jquery version in richfaces
                sumathra

                Yes.

                • 5. Re: How to find jquery version in richfaces
                  sumathra

                  Thanks, It works. I used '$' instead of jQuery by mistake.

                  • 6. Re: How to find jquery version in richfaces
                    feuyeux

                    I just use

                    alert(jQuery.fn.jquery);

                    without

                    jQuery.noConflict();

                    it works. my richfaces is 3.3.3 and draw a alert is 1.3.2.

                     

                    I want to know when you add a new version to your project, does it work well on ie?

                    I gain many errors and exceptions from the new jQuery version, since the richfaces use the old one.

                     

                    How to solve it on 3.3.3 and which jQuery version will be used in richfaces4?

                     

                    Thank you all very much!

                    • 7. Re: How to find jquery version in richfaces
                      nbelaevski

                      Lu,

                       

                      RF 4 uses the latest one (1.4.4).

                       

                      There are some significant changes between 1.3 & 1.4 jQuery versions, so some 3.x widgets can break after upgrade. What errors does IE show and how are you upgrading it - replacing jquery.js in RF .jar or smth. other?

                      • 8. Re: How to find jquery version in richfaces
                        feuyeux

                        Hi Belaevski,

                        Thanks for your reply. It's useful!

                        what i did is:

                        add the declaration and noconflection in template.xhtml which is jsf template file in our project.

                        <script  type="text/javascript" src="${faceEnv.jsFilePath}/jquery1.4.4.js"  />

                        <script  type="text/javascript">

                             jQuery.noConflict();

                             ...

                        </script>

                        And, I had never changed any code from richfaces3.3.3 -- our project depends on its jars by using maven(pom.xml).

                        Then, save and run.

                        There is no problem on other browsers, excluding ie -- my env. is ie8.

                        And the errors come from richfaces3.3.3 and jQuery1.4.4, which said approximately "something is null or not object".

                        Finally, I remove the new version reference, and I think it must has other jQuery version in my project(At that time, I was not sure richfaces included jQuery).

                        So, I reserve the other lines.

                         

                        <script  type="text/javascript">
                             jQuery.noConflict();
                             ...
                        </script>

                        <script  type="text/javascript">

                             jQuery.noConflict();

                             alert(jQuery.fn.jquery);

                             ...

                        </script>

                         

                        Save and test it, and it works well.

                         

                        By the way, I want to ask you another question:

                        Does richfaces3.3.3 use jQuery only one version--1.3.2 or use many different versions in different package(ui component,api or impl).

                         

                        BR,

                        Lu H.

                        • 9. Re: How to find jquery version in richfaces
                          feuyeux

                          Hi Nick Belaevski,

                          Since we decide to stand on rf3.3.3 and don't migrate to rf4.0, It's still a puzzle that upgrading jQuery version in rf.

                          How can I just upgrade jQuery from 1.3.2 to 1.4(or 1.5.1) in richfaces3.3.3?

                          Or if it's clear that no way to do this, please tell me why.

                           

                          This is an urgent question, anyone if you know the solution, please reply me soon.

                           

                          Thanks a lot!

                           

                          Lu H.

                          • 10. Re: How to find jquery version in richfaces
                            feuyeux