Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3612

Ajax link does not update content which includes another ajax link until second (or further) click

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.5-RC3
    • None
    • None
    • None
    • jdk1.6.0_07, jetty:run, Firefox 4, Chrome 12, IE 7, Windows

    Description

      Starting from a 1.5-RC3 quick start I have the following homepage.java and corresponding markup

      http://pastebin.com/C7nPE4Lb
      http://pastebin.com/kaUg960w

      The homepage contains a button, and a table with rows to be updated.

      The button is handled by AjaxFallbackLink, and add rows to the table.

      Each row contains a simple label and a link. This link also handled by AjaxFallbackLink (but it does nothing)

      When visiting the page for the first time, and clicking the button, there is no update to the page (no rows added to the table). I have verified with the ajax-debug dialog that the correct markup is returned to the browser, but the browser is not updating said markup.

      If the button is clicked a second time, the markup does update, and includes two rows, one for the current click, and one for the previous click which did not have any effect.

      Subsequent clicks work correctly.

      Further observations:

      • If I remove the link from the row of the table, the rows update correctly (the rows only contain the label)
      • If I change the link to a normal Link, instead of AjaxFallbackLink, the rows update correctly
      • I have verified with firebug that the first click of the button causes the following javascript file (and two others) to be downloaded

      http://localhost:8080/wicket/resource/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax-ts1302183319615.js

      this corresponds to this line in the response to the ajax button click response (as shown in ajax debug dialog):

      <script type="text/javascript" src="./wicket/resource/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax-ts1302183319615.js"></script>

      Upon loading the page in the browser and using view source I see this line in the normal markup:

      <script type="text/javascript" src="wicket/resource/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax-ts1302183319615.js"></script>

      It seems the browser should not be downloading the same javascript file again, it should already have it from the original page load. The only difference between the two script tags is that the one found in the ajax response begins with "./wicket/.." and the normal page load with "wicket/.."

          • If I manually add the script tag as found in the ajax response to the head section of the markup in homepage.html, the problem disappears (and the browser does not reload said javascript file on the ajax request) ***

      Attachments

        1. example.zip
          99 kB
          david ruescas

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fastness david ruescas
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: