Re: WicketTester and AjaxFormComponentUpdatingBehavior

2015-01-14 Thread Simon B
This came up a while ago, I just wanted to say that I've been having the same
problem

And solved it in the same way, by recreating the form and changing the
value.

Like the original poster said I'm not sure why doing that makes it work, but
it does.

Cheers
Simon

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketTester-and-AjaxFormComponentUpdatingBehavior-tp2067951p4669007.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



WicketTester and AjaxFormComponentUpdatingBehavior

2010-04-27 Thread Arnaud Garcia
Hello,

There was a previous thread, but it is not clear for me..., I have something
which is working, but I don't understand why :

http://apache-wicket.1842946.n4.nabble.com/WicketTester-No-Form-onSubmit-when-using-Ajax-DropDownChoice-Component-td1877797.html#a1877797

So, when you want to test a form wich contains a Component with an
AjaxFormComponentUpdatingBehavior, the submit method of the FormTester
doesn't work as expected.


To succeed I have to create and fill another FormTester without submitting
it.

here the code:

  private void fillForm(FormTester form) {
form.setValue("my:path:...:", "test");
   
}

public void testADD() {
tester.startPage(APage.class);
FormTester form = tester.newFormTester("my:path:form");
fillForm(form);
tester.executeAjaxEvent("a:path", "onblur");
form.select("another:path", 2);

FormTester jokerForm = tester.newFormTester("my:path:form"); <
same form
fillForm(jokerForm);  <=== - If I don't fill this form it does not
work (Even if it will never be send, there is no jokerForm.submit() ??)
   - And I don't need to add
the jokerForm.select("another:path",2);

form.submit(); <== JUST ONE FORM IS SUBMITTED

}
}

Any Idea ?


Arnaud