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

BaseWicketTester chooses a disabled component as the source of an AjaxFormSubmit event

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.4
    • 1.4.6, 1.5-M1
    • wicket
    • None
    • Linux, Sun JDK 1.6

    Description

      As of 1.4.4, disabled components can no longer submit forms (and rightly so):

      http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java?r1=835242&r2=829503

      BaseWicketTester, however, doesn't check whether a submitting component is enabled when it chooses a component as the source of a submit event, it only checks the visibility:

      http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java?r=835641#l1287

      We have a TextField with an AjaxFormSubmitBehavior, and in the same form there's a disabled AjaxButton. In our test, we trigger a submit event from the TextField, but BaseWicketTester sets the disabled AjaxButton as the source, causing the check in Form.java to fail and throw an Exception.

      In the browser everything works fine, since the AjaxButton's inputName=value is not added to the request parameters, as expected.

      Attachments

        1. WICKET-2616.patch
          0.8 kB
          Jari Aarniala

        Activity

          People

            jdonnerstag Juegen Donnerstag
            jari Jari Aarniala
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: