Announcement Announcement Module
No announcement yet.
Spring JS documentation Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring JS documentation

    Could somebody please direct me to the documentation for Spring JS (which comes with Webflow) ? (Oh, and the stuff that currently comes in the Webflow documentation near the end is pathetically inadequate, so please don't bother mentioning it.)

  • #2

    I'd also be interested to know if there is any documentation for this. As alexmarshall points out, the 'Spring JS Quick Reference' in the Web Flow docs is not enough.


    • #3

      Yes, I'm still paying attention to this thread as well. Does anybody out there have any idea if more documentation for Spring JS is forthcoming ?


      • #4
        I'll let Jeremy comment specifically on the roadmap for Spring JavaScript, which include making it its own top-level Spring project this year. One of the goals in the roadmap is to enhance the documentation to cover more practical use cases for things you can do with the library.

        However, with that said, it would be good to get some more concrete information on how you would like to see the documentation improved. What do you want to know how to do with the library? What are you looking for specifically in the documentation that is not there now? Investing some time explaining concretely what you would like to see would help benefit the Spring community as a whole.




        • #5
          Hi Keith,

          Thank you very much for your response. I've so far used Spring JS to create modal dialogs (but it would have been nice to have had documentation for this scenario to make it go faster). I'm planning on migrating our company's main application to Webflow 2 (it's currently using Webflow 1) specifically so that I can make use of its Ajax capabilities. I'd very much like to see coverage for things like form and link callouts (ie AJAX form / link submissions as well as handling the results). I'd also very much like to see coverage of Spring JSs usage of dijits (Dojo Widgets) and coverage of how to use Spring JS to access Dojo's validation functionality.

          Currently, the documentation provides a very high level overview, with very few concrete examples, none of which are very good at explaining what Spring JS is doing and why, few of which are at all useful. Implementing the modal dialogs was a pain because I had to thoroughly examine the Dojo documentation on top of the Spring documentation, and poke around changing various variables and parameters to find out what things did. I know all the above functionality is in there because I've gone over the code, but documentation and specific examples for the above use cases would be extremely useful. Thank you kindly.
          Last edited by alexmarshall; Jan 14th, 2009, 12:47 PM. Reason: Added extra info


          • #6
            Thanks - I'm looking forward to Jeremy's update on the roadmap. A few things I think would be good to see documented (in addition to those alexmarshall describes):
            * API-style reference for the Spring.* functions and types
            * More on why you would use Spring JS rather than 'vanilla' Dojo
            * Examples comparing doing something with and without Spring JS to allow a comparison to be made, e.g. if constructing a Dijit programmatically, you have to explicitly dojo.require the Dijit.
            * Performance tips - e.g. I'm aware that including a script tag in the page body causes the browser to halt rendering while it runs the script. Could this be avoided/alleviated?

            Maybe some of these would work better as articles rather than documentation as such.


            • #7
              Hello Keith,

              i would like to see the following improvements for the spring-js documentation:
              • a clear api of spring-js
              • an example of how to use a custom dojo widget with spring js
              • an example of how you can use your own custom dojo build ( == make use of a custom layer with spring-js)
              • Some examples on the various ways to decorate the html elements

                most examples put the script to decorate an element in the body right behind the element

                i assume it would be possible to put something like this in an external javascript file:

                        Spring.addDecoration(new Spring.ElementDecoration({
                        elementId: "targetId",
                        widgetType: "dijit.form.ValidationTextBox",
                        widgetAttrs: { required:"true" }}));
                        /* or even */
                        dojo.query(".dateTextbox").forEach(function(element) {
                        Spring.addDecoration(new Spring.ElementDecoration({
                            widgetType : "dijit.form.DateTextBox"
              • a sort of quickstart for the dojo.query function and the various function ofa Nodelist (i know this is really dojo, but since most of us don't have that much experience with dojo, and since those things are really usefull to target te elements you want to decorate, it really would be a nice-to-have in the documentation )

              Keep up the good work,



              • #8
                Can I use Spring JS with prototype or any other...

                I want to know if actually Spring JS is designed to be used without dojo and to be served from simples controllers returning JSON data?? especifically an prototype integration without any widget just for decorating the element to talk with the server and take the advantage of javascript disabled. I would aprecciate any suggestions around this idea


                • #9
                  Originally posted by aek View Post
                  I want to know if actually Spring JS is designed to be used without dojo
                  As far as i know, Spring JS is an abstraction of dojo, to easily decorate the html elements with dojo. It has to be possible though to use the resourceservlet to provide other files.

                  Originally posted by aek View Post
                  especifically an prototype integration without any widget just for decorating the element to talk with the server and take the advantage of javascript disabled
                  I don't really understand this part of your question.
                  If javascript is disabled Spring JS won't work


                  • #10
                    javascript disabled

                    spring-js has this feature, when an element is decorated, the functionality of the element its changed, but when the javascript is disabled in the browser, the functionality is still working without the decoration. an example from the SWF reference documentation:
                    <a id="prevLink" href="search?searchString=${criteria.searchString}&page=${ - 1}">Previous</a>
                    <script type="text/javascript">
                    Spring.addDecoration(new Spring.AjaxEventDecoration({
                    elementId: "prevLink",
                    event: "onclick",
                    params: { fragments: "body" }
                    when javascript is disabled the link is still working because of the href value
                    this is the feature that I want but without Dojo, SWF, JSF, or Tiles.
                    don't you think that this would be a good toy to integrate with the AJAX framework of your choice?


                    • #11
                      Originally posted by aek View Post

                      when javascript is disabled the link is still working because of the href value
                      this is the feature that I want but without Dojo, SWF, JSF, or Tiles.
                      That is called unobtrusive javascript.

                      It's not something that exists only with dojo / Spring JS.

                      PS: Since the thread is about Spring JS documentation, this is getting off-topic. Consider starting a new thread


                      • #12
                        This is going to be a bit off-topic, but has anybody had any success creating an Ajax Updater with Spring JS ? Ie Using a Spring.* function to decorate a link that calls out to the server, gets the flow to render a fragment, and then update a node.innerHTML on the current page with the content of the returned fragment ? I'd really appreciate it if somebody could provide advice on this. Thank you kindly.


                        • #13
                          Spring Javascript and tabs

                          I'd like to add my two cents for Spring JS docs here regarding tabs. I have been attempting to replicate the TabContainer sample to work using Spring JS and have come across a few strange items

                          For whatever reason, there is a source file not included in the web flow JS lib, called "dojo.xd.js" that appears to be loaded via a URL to aolcdn. Using that link, I only get a blank screen running my sample code.

                          But that's not the weird part - when I look at the page source, everything is there - all my code data I'm expecting. The dispatch works just fine, logging shows all the biz logic is working fine, everything but the display.

                          No errors occur anywhere, i.e not in logging, not in console, not in firebug - all I get is blank screen
                          I tried downloading the dojo.xd.js and importing it into my project. Same results.

                          Anyone else note this? Also, in the dojo samples, there is a djConfig="parseOneLoad: true" attribute, but I didn't see that in Chapter 11 of the Webflow document where to add or how to decorate that.

                          Last edited by shane.funk; Mar 23rd, 2009, 03:08 PM. Reason: forgot my closing thoughts


                          • #14
                            ok, now it seems to work...don't know why

                            my previous post, I attempted to incorporate TabContainer and before, no matter what I attempted, got a blank screen.

                            So I went back and first added the "Hello World" widget and got that to work. If you look at Section 11.3 of the online documentation, you'll see
                            <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"> </script>
                            <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"> </script>
                            <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"> </script>
                            so I have this in an include.jsp page with the following differences - 1) added djConfig="parseOnLoad: true" to dojo.js, and added a 4th line, also with this same attribute
                            <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />" djConfig="parseOnLoad: true"></script>
                            <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"> </script>
                            <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"> </script>
                            <script type="text/javascript" src="" djConfig="parseOnLoad: true"></script>
                            and after restarting the server, I was able to get the tabs, the stylesheet and my Spring MVC code to all play nice as expected.


                            • #15
                              I know this thread is somewhat stale but I'm wondering if there has been any progress in the area of Spring JS documentation since this thread has died off (almost 2 years to the day!). I recently upgraded from SWF 2.0.6 to 2.3 and was dismayed to find the same "Spring JS (Super) Quick Reference" section in the reference documentation. What I'd like to see is simply some api documentation around the available *Decoration objects that spring js provides. For example, what are the available configuration params available to AjaxEventDecoration and a description of each param. If anyone know of such documentation or at least some additional resources regarding Spring JS and SWFs partial page rendering, I'd greatly appreciate pointing me in that direction (I've already explored the reference docs and sample apps) Thanks!