Hi list, I'm new to wicket. I've some problem with a Formteser.submitLink that should sumbit a form throught a link that stay outside the form. I've played with the wicket provided test case org.apache.wicket.markup.html.link.submitLink.FormPage and FormPageTest. in the FormPage I've changed the definition of somevalue deleting the final keyword
protected int somevalue = 1; In the TestCase I changed the testFormAndLinkAreSubmitted as follows, simply setting a value in the field before the submitLink and then verify in the model the correctness of the value. but fails, as if the submitLink doesn't post the data. public void testFormAndLinkAreSubmitted() { WicketTester tester = new WicketTester(); tester.startPage(FormPage.class); FormPage page = (FormPage)tester.getLastRenderedPage(); Assert.assertFalse(page.isSubmitLinkSubmitted()); Assert.assertFalse(page.isFormSubmitted()); FormTester formTester = tester.newFormTester("form"); formTester.setValue("field", "2"); formTester.submitLink("link", true); page = (FormPage)tester.getLastRenderedPage(); Assert.assertTrue(page.isFormSubmitted()); Assert.assertTrue(page.isSubmitLinkSubmitted()); tester.assertModelValue("form:field", 2); } It's a bug or a mine misunderstanding?Somebody could help me, please? Many thanks in advance Andrea Selva