3 Replies Latest reply on Oct 26, 2012 1:37 PM by jmiguel77

    jQuery Plugin Usage in RichFaces 4.

    sarojkr

      Hi,
            I'm trying to create a modal popup in jQuery in JSF 2.0 / Richfaces 4 Application. jQuery works fine as is, say $('#myDiv').css. But jQuery plugins fail like $.blockUI(); I get the error message, the object does not support his property or value.

      jQuery Version : 1.4.4

                How do I resolve this ? How do I use jQuery Plugins in Richfaces 4 Application.

       

      Thanks,

      Saroj

        • 1. Re: jQuery Plugin Usage in RichFaces 4.
          sarojkr

          The below solution worked

          1.The jQuery plugin was put into WebContent\resources folder

          2.The plugin was included using into the body of the page NOT the head.

          • 2. Re: jQuery Plugin Usage in RichFaces 4.
            ilya_shaikovsky

            actually you have to use jQuery plugin compatible with jQuery shipped with RichFaces. And do not loaded your own version of jQuery but use built-in one. In other case unpredictable conflicts could appear.

            • 3. Re: jQuery Plugin Usage in RichFaces 4.
              jmiguel77

              I am trying to do something similar

               

              The problem is that, the h:outputScript tag happens BEFORE the inclusion of the jquery that comes inside the richfaces distribution. Because of that, the jquery plugin fails miserably

               

              Furthermore, if i try to do this

               

              <h:outputScript name="util.js" library="js" />

               

              And in the util.js i try to use jQuery stuff, it also fails

               

              I think that it would be a better solution to bring back the a4j:loadScript component and add a priority variable that should state if the script being loaded should be loaded after the richfaces stuff, or before. I don't really like the solution of including scripts outside the head section

               

              Is there any other solution at the time ???