Re: wicketTester.executeAjaxEvent not working

2010-01-11 Thread Alexander Elsholz
Hi,

wicket 1.4? 

try: 
((ServletWebRequest) baseWicketTester.getWicketRequest()).setAjax(true)

mfg alex




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



wicketTester.executeAjaxEvent not working

2010-01-07 Thread Verma Shalini (HCTM/ETA)

I'm trying to write a test case in which I'm having onChange event for
the drop down. I also have textfield as well.
When I submit the form I don't get the value of the textfield.
But if I comment the onChange event call then I'm able to get the value
of the Text Field.


Any help...

 @Test
public void testDummyPage() throws Exception
{
TestPage testPage = new TestPage(id);
wicketTester.startPage(testPage);

// assert rendered field components
wicketTester.assertComponent(form:txtName, TextField.class);
wicketTester.assertComponent(form:department,
DropDownChoice.class);
wicketTester.assertComponent(form:employee,
DropDownChoice.class);

FormTester formTester1 = wicketTester.newFormTester(form);
formTester1.setValue(txtName, test);
formTester1.select(department, 0);


wicketTester.executeAjaxEvent(form:department, onchange);
wicketTester.assertComponentOnAjaxResponse(form:employee);

formTester1.select(employee, 1);

formTester1.submit();

 
Assert.assertEquals(formTester1.getTextComponentValue(txtName),
test);

DropDownChoice dropDownChoice = (DropDownChoice)
wicketTester.getComponentFromLastRenderedPage(
form:department);

System.out.println( dropDownChoice  +
dropDownChoice.getModelObjectAsString());
System.out.println( department  +
formTester1.getForm().get(department));
Assert.assertEquals((dropDownChoice.getModelObjectAsString()),
HR);
}


Re: wicketTester.executeAjaxEvent not working

2010-01-07 Thread shetc

Just dealt with this issue:

http://old.nabble.com/WicketTesterNo-Form-onSubmit-when-using-Ajax-DropDownChoice-Component-td27006022.html
http://old.nabble.com/WicketTesterNo-Form-onSubmit-when-using-Ajax-DropDownChoice-Component-td27006022.html
 
-- 
View this message in context: 
http://old.nabble.com/wicketTester.executeAjaxEvent-not-working-tp27069307p27069445.html
Sent from the Wicket - User 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