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

Fast multiple clicks on Link bound on non-<A> element causes error.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0-rc2
    • 1.3.0-final
    • wicket
    • None
    • Tomcat 6, Firefox 2.0.0.11, Linux

    Description

      When you attach a link component to some other element that <A>, fast clicking on the element causes usually errors.

      This issue can be demonstrated for example by creating link on table cell with html code:
      ...
      <tr>
      <td wicket:id="alink"
      style="width: 100px; height: 100px; background-color: red;">alink</td>
      </tr>
      ...

      and Java code:
      ...
      add(new Link("alink") {
      public void onClick()

      { setResponsePage(TestPage.class); }

      ;
      });
      ...

      Now if you for example double-click the link you will probably get HTTP 404 or some other error.

      I think that the problem is caused by the onclick event processing and relative urls.

      For example by double-clicking a link, two onclick events are fired. First event sets the window.location.href to correct address appending the relative url "ExamplePage/param1/val1" to current url. Second event appends the "ExamplePage/param1/val1" again and now the resultant address is incorrect "ExamplePage/param1/val1/ExamplePage/param1/val1".

      Attachments

        1. TestApp.war
          1.46 MB
          Mika Salminen
        2. testapp-src.zip
          4 kB
          Mika Salminen

        Activity

          People

            knopp Matej Knopp
            mika Mika Salminen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: