Announcement Announcement Module
Collapse
No announcement yet.
jQuery support for Roo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jQuery support for Roo

    Hi,
    We have been testing Roo for some projects that need jQuery. Are there any known issues with pluging in jQuery.

    -Irshad

  • #2
    Hi Irshad,

    We are currently working on revamping the JSP scaffolding for Roo. Part of this is that we want to support different JS solutions like JQuery, YUI, ExtJS, and Dojo. You can expect to see us providing the first milestones of this new support by end of February - early March.

    If you are asking if there are any technical reasons why the integration between JQuery and Spring MVC would not work - I am not aware of any. In fact, Keith Donald has just recently published a blog post to show it in action:

    http://blog.springsource.com/2010/01...in-spring-3-0/

    HTH,
    Stefan

    Comment


    • #3
      Hi guys,

      Just to know, will these JS solutions be compatible with GWT?

      Comment


      • #4
        As you know GWT is itself generating JS code so I am not quite clear what you are asking for here. I have not seen the need for mixing GWT with other JS frameworks.

        If you are asking if we are working on support for GWT scaffolding as an alternative to the current Spring MVC scaffolding, then yes, we are working on that.

        -Stefan

        Comment


        • #5
          That's what I meant, thanks Stefan

          Comment


          • #6
            jquery integration with Roo for Release 1.1 ?

            Hi,

            As part of Release 1.1, are there plans to provide integration with JQuery for Roo? I wish to use JQuery instead of Dojo for a project and it would have been great if Roo could created scaffolding for JQuery as it does for Dojo toolkit...

            Thanks,
            Ratish

            Comment


            • #7
              I have not seen any immediate plans for JQuery and from what I have gathered in y informal meetings with spring source people is that they have a good relationship with dojo people.

              Is there any thing in particular that you need from JQuery that is not present in dojo. is there any thing in specific that Dojo is stopping you to do?

              You can always integrate both libraries.

              Comment


              • #8
                Originally posted by Stefan Schmidt View Post
                Hi Irshad,

                We are currently working on revamping the JSP scaffolding for Roo. Part of this is that we want to support different JS solutions like JQuery, YUI, ExtJS, and Dojo. You can expect to see us providing the first milestones of this new support by end of February - early March.

                If you are asking if there are any technical reasons why the integration between JQuery and Spring MVC would not work - I am not aware of any. In fact, Keith Donald has just recently published a blog post to show it in action:

                http://blog.springsource.com/2010/01...in-spring-3-0/

                HTH,
                Stefan
                Hi Stefan,

                I've been searching on google a way to integrate Spring Roo and Jquery, but the maximum I've found was this quote. A year has passed, and the Spring Roo Team has plans to continue that feature? And if not, who could I add Jquery on my Roo Project avoiding to create a new add-on or removing dojo references?

                Comment


                • #9
                  Originally posted by dcms View Post
                  Hi Stefan,

                  I've been searching on google a way to integrate Spring Roo and Jquery, but the maximum I've found was this quote. A year has passed, and the Spring Roo Team has plans to continue that feature? And if not, who could I add Jquery on my Roo Project avoiding to create a new add-on or removing dojo references?
                  Did you already try the load-scripts.tagx ?

                  Comment


                  • #10
                    I am currently working on a web application project that uses Spring Roo 1.1.5 and initially I wanted to use jQuery too as that was my previous experience and I had little knowledge of Dojo. Not as easy as you would hope unfortunately but I hope these few points might help people out:

                    The Spring JavaScript library and jQuery do not work together by default. If you add the following jQuery lines to the load-scripts.tagx file:

                    <spring:url value="/css/south-street/jquery-ui-1.8.14.custom.css" var="jquery_css_url" />
                    <spring:url value="/js/jquery-1.5.1.min.js" var="jquery_url" />
                    <spring:url value="/js/jquery-ui-1.8.14.custom.min.js" var="jquery_ui_url" />
                    <link rel="stylesheet" type="text/css" media="screen" href="${jquery_css_url}"><!-- required for FF3 and Opera --></link>
                    <script src="${jquery_url}" type="text/javascript"><!-- required for FF3 and Opera --></script>
                    <script src="${jquery_ui_url}" type="text/javascript"><!-- required for FF3 and Opera --></script>

                    you will find Spring Dojo functionality will not work.

                    To get around this I have taken three basic approaches (waiting in hope that jQuery will be supported nicely in Spring Roo / Spring MMV) to get around this:

                    1. Limited jQuery usage - I use the default scaffolds for the administration aspects of my site (that need vanilla CRUD functionality) and have avoided jQuery here. This decision meant I had to learn dojo.xhrGet() (Dojo AJAX calls) but this was no more difficult that using the similar jQuery functionality.

                    2. Only use jQuery on a page - I simply created a load-jquery-scripts.jspx tag to load jQuery and avoid Dojo. I use this tag and jQuery on the main UI, then switch to Spring Roo Dojo generated stuff for edit forms etc. This 'works' well enough as the overall layout can be tempated with Tiles and the correct JavaScript library chosen.

                    3. If you need to mix jQuery and Dojo then you can do this if you avoid the use of the Spring JavaScript stuff. To do this you simply add all the jQuery sections to another util tag library (say load-all-scripts.jspx) and comment out the following:

                    <!--<spring:url value="/resources/spring/Spring.js" var="spring_url" />-->
                    <!--<spring:url value="/resources/spring/Spring-Dojo.js" var="spring_dojo_url" />-->

                    and

                    <!--<script src="${spring_url}" type="text/javascript">&lt;!&ndash; /required for FF3 and Opera &ndash;&gt;</script>-->
                    <!--<script src="${spring_dojo_url}" type="text/javascript">&lt;!&ndash; required for FF3 and Opera &ndash;&gt;</script>-->

                    Then to use Dojo I simply make the calls manually instead of using the Spring.addDecoration stuff that Spring Roo produces. Again this is pretty easy... instead of say:

                    <page:list id="pl_gov_uk_london_ems_domain_nomination_Candida te" items="${candidates}" z="DxLsb0i/D/ICLfai9vQmTK1TQwE=">
                    ...
                    </page>

                    you get

                    <script type="text/javascript">dojo.require("dijit.TitlePane");</script>
                    <div id="_title_pl_gov_uk_london_ems_domain_nomination_ PoliticalParty_id" dojoType="dijit.TitlePane" class="dijitTitlePane" title="List all Political Partys">
                    ...
                    </div>
                    <script type="text/javascript">dojo.parser.parse();</script>

                    So in that example you get the standard title pane layout but my div then contains a jQuery table.

                    All of that is pretty hacky and not very nice but I have found that this has allowed me to benefit the most from the web scaffolding whilst also coding the essential UI elements in jQuery. For me learning Dojo in more detail was not really an option due to budget and time constraints - I would certainly prefer to have a jQuery native option and feel this would greatly enhance the utility of a Spring Roo web solution.

                    Of course I also think that a Spring Roo - Backbone JavaScript framework combination (with Spring Roo producing the RESTful web api) might be a better combination again and something I would be interested in investigating.

                    Comment


                    • #11
                      Is there a better solution meanwhile?

                      Comment


                      • #12
                        At present no... but there appear to be things in the works

                        As you may have seen there are heaps of comments about jQuery on the forum.

                        Various members have been suggesting jQuery addons as well so I certainly hope there will be a jQuery alternative for Spring Roo sooner rather than later.

                        At present though I think, if you want to create a jQuery based web application with lots of JavaScript features etc. then you might want to consider whether Spring Roo will help. If like my project (http://forum.springsource.org/showth...ercial-project) only a portion of the application needs a swish UI then I still think Spring Roo may help.

                        Chris

                        Comment


                        • #13
                          There an update for this?

                          Comment


                          • #14
                            I am also very interested in completely replacing Dojo in Roo with jQuery.

                            1. Is this something planned for the future Roo releases?

                            2. Would I be able to do this if I developed a Roo addon?

                            Thank you

                            Comment


                            • #15
                              Checkout the jsf roo addon (based on Primefaces with jQuery)

                              Originally posted by anton1980 View Post
                              I am also very interested in completely replacing Dojo in Roo with jQuery.

                              1. Is this something planned for the future Roo releases?

                              2. Would I be able to do this if I developed a Roo addon?

                              Thank you
                              Hi,

                              take a look at the JSF Roo addon. It uses Primefaces and Primefaces itself uses jQuery. jQuery plugins could be well integrated in JSF pages in this setup.

                              Best regards,
                              Florian

                              Comment

                              Working...
                              X