Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2352

remote DIV incorrect behavior (different from v2.0.x)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • Plugin - Dojo Tags
    • None
    • Fedora 6, Tomcat 6.x, Firefox 1.5.x

    Description

      Dojo remote DIV does not work the same as in 2.0.9, there is an issue related to the preload, updateFreq and delay parameters.

      In version 2.0.x the remote DIV UI tag was (when setting updateFreq > 0) initially rendering the content of the DIV by immediately invoking the target action. In version 2.1.x on the other hand, when setting updateFreq > 0, the remote DIV does not initially render the content of the target action, I did some research and tried using new parameters autoStart="true" preload="true" but does not work either. In version 2.1.x you have to wait the updateFreq before you see anything rendered ...

      Please have a look at the example with title "Ajax UI tags were moved to the new dojo plugin ..." placed under:
      http://cwiki.apache.org/confluence/display/S2WIKI/Troubleshooting+guide+migrating+from+Struts+2.0.x+to+2.1.x

      The example illustrates using the remote DIV in a JSP before and after migrating to 2.1.x I experience the problem described in exactly that example.

      The key parameters in this issue are these:

      • delay: "How long to wait before fetching the content (in milliseconds)"
      • updateFreq: "How often to reload the content (in milliseconds)"
      • preload: "Load content when page is loaded"

      The closest I could get to the "would be" a BUG was in file: plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/BindDiv.js
      line 258
      *******************************************************************
      if(this.isShowing() && this.preload && this.updateFreq <= 0 && this.delay <= 0)
      {
      this.refresh();
      }
      *******************************************************************

      Obviously if you set either updateFreq or delay > 0 then it would not refresh upon startup.

      I tried modifying that source to:
      if(this.isShowing() && (this.preload || (this.updateFreq <= 0 && this.delay <= 0)))
      {
      this.refresh();
      }

      but did not work either, from there on I need more understanding of the DOJO library. I will keep digging it further as soon as I have a chance.

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            bravegag Giovanni Azua
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: