You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Christoph Radtke (JIRA)" <ji...@apache.org> on 2014/06/18 17:42:24 UTC

[jira] [Created] (WICKET-5622) WicketTester behaves odd when using AjaxFormComponentUpdatingBehavior on CheckBox

Christoph Radtke created WICKET-5622:
----------------------------------------

             Summary: WicketTester behaves odd when using AjaxFormComponentUpdatingBehavior on CheckBox
                 Key: WICKET-5622
                 URL: https://issues.apache.org/jira/browse/WICKET-5622
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 6.15.0, 7.0.0-M1
         Environment: Windows 7 Prof. x64 latest SP & updates, java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
            Reporter: Christoph Radtke
         Attachments: quickstart-AjaxFormComponentUpdatingBehavior-wickettester.zip

I'm wsing an AjaxFormComponentUpdatingBehavior on a CheckBox which works fine on the page.
But testing said constraint with WicketTesters FormTester does not react as expected.

Setup is a form with a checkbox and a submit button. The form has a model (MyModel.class), which binds a boolean ("state") to the checkbox.
The checkbox has an AjaxFormComponentUpdatingBehavior (i use this in my real project to toggle enabled of certain form components).

To test the component i use this code:

FormTester ft = tester.newFormTester("frm");
ft.setValue("state", true); // setup the value
tester.executeAjaxEvent(state, "click"); // trigger the ajax event
ft.submit();

Surprisingly after submit the state has become false. I discovered the faulty behavior is caused by the AjaxFormComponentUpdatingBehavior.

Quickstart attached



--
This message was sent by Atlassian JIRA
(v6.2#6252)