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

onclick is null or not an object in IE6, IE7; Form.appendDefaultButtonField

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.3, 1.4-M1
    • 1.3.6, 1.4-RC2
    • wicket
    • None
    • Windows XP Professional, glassfish, Internet Explorer 6 and Internet Explorer 7

    Description

      JavaScript error when radio button has focus and return key is pressed:

      IE6 and IE7 report a script error ("'onclick' is null or not an object"), which IMHO may be fixed in method

      • protected void org.apache.wicket.markup.html.form.Form.appendDefaultButtonField(final MarkupStream markupStream, final ComponentTag openTag)

      on line:

      buffer.append("'); if (typeof(b.onclick) != 'undefined')

      { var r = b.onclick.bind(b)(); if (r != false) b.click(); } else { b.click(); }; return false;\" ");

      It works for me replacing this line by:

      buffer.append("'); if ((b.onclick != null) && (typeof(b.onclick) != 'undefined')) { var r = b.onclick.bind(b)(); if (r != false) b.click(); }

      else

      { b.click(); }

      ; return false;\" ");

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            tinl Martin Müller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.25h
                0.25h
                Remaining:
                Remaining Estimate - 0.25h
                0.25h
                Logged:
                Time Spent - Not Specified
                Not Specified