Re: WicketTester, FormTester, and AjaxSubmitLink

2007-09-26 Thread Jean-Baptiste Quenot
* James McLaughlin:
 Hi,
 Hacking away at some tests, I figured the proper way to test an
 AjaxSubmitLink would have been as follows:
 
 Panel p = tester.startPanel(EventPanel.class);
 FormTester ft = tester.newFormTester(p.getId() + :eventForm);
 ft.setValue(messageField, ALARM_MESSAGE);
 tester.clickLink(p.getId() + :eventFormSubmitLink, true);
 
 However, the values set in the FormTester don't get submitted for some
 reason. It works if I change it to:
 
 Panel p = tester.startPanel(EventPanel.class);
 tester.setParameterForNextRequest(p.getId() +
 :eventForm:messageField, ALARM_MESSAGE);
 tester.clickLink(p.getId() + :eventFormSubmitLink, true);
 
 which while 1 line briefer, didn't seem intuitive (to me at least). Is
 it possible to make it work like the former, or is it better left as
 it is?

Is it WICKET-932?
-- 
 Jean-Baptiste Quenot
aka  John Banana   Qwerty
http://caraldi.com/jbq/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



WicketTester, FormTester, and AjaxSubmitLink

2007-09-06 Thread James McLaughlin
Hi,
Hacking away at some tests, I figured the proper way to test an
AjaxSubmitLink would have been as follows:

Panel p = tester.startPanel(EventPanel.class);
FormTester ft = tester.newFormTester(p.getId() + :eventForm);
ft.setValue(messageField, ALARM_MESSAGE);
tester.clickLink(p.getId() + :eventFormSubmitLink, true);

However, the values set in the FormTester don't get submitted for some
reason. It works if I change it to:

Panel p = tester.startPanel(EventPanel.class);
tester.setParameterForNextRequest(p.getId() +
:eventForm:messageField, ALARM_MESSAGE);
tester.clickLink(p.getId() + :eventFormSubmitLink, true);

which while 1 line briefer, didn't seem intuitive (to me at least). Is
it possible to make it work like the former, or is it better left as
it is?

best,
jim

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]