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

ExternalLink JavaScript not working in FF 3

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.3
    • 1.3.5, 1.4-RC1
    • wicket
    • None
    • WinXP; Firefox 3.0 Beta 5

    Description

      If the link target isn't a proper anchor, the code generates a JS on-click handler, i.e.
      tag.put("onclick", "window.location.href='" + url + "';");
      which generates code such as
      onclick='window.location.href="http://news.bbc.co.uk";'

      The problem is that when this is used with a button /in a form/, while this works with IE & FF2, it appears that FF3 needs a 'return false;' at the end of the JS before it works, otherwise it just treats the button as a 'submit' action.

      So, is there any down-side to changing the above line in
      \org\apache\wicket\markup\html\link\ExternalLink.java
      to be
      tag.put("onclick", "window.location.href='" + url + "'; return false;"); ?

      /Gwyn

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            gwynevans Gwyn Evans
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: