Re: Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread Sven Meier
Hard to tell, the code looks fine to me :/ Have fun Sven On 01.06.20 15:09, leodali83 wrote: Hello Sven, actually it helps a bit, some error feedback messages related to the 2 input fields on which I set the value just after instantiation of FormTester disappered. Therefore, test fails again

Re: Locatable UnsupportedOperationException

2020-06-01 Thread Martin Grigorov
https://issues.apache.org/jira/browse/WICKET-6796 On Mon, Jun 1, 2020 at 4:08 PM Sven Meier wrote: > +1 that should have no negative impact > > Sven > > On 01.06.20 11:22, Martin Grigorov wrote: > > Hi, > > > > I like the idea to catch UnsupportedOperationException at > > org.apache.wicket.IGene

Re: Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread leodali83
Hello Sven, actually it helps a bit, some error feedback messages related to the 2 input fields on which I set the value just after instantiation of FormTester disappered. Therefore, test fails again signaling the second dropdown (e.g. "secondDropDownSelect") is required, which actually it is. Af

Re: Locatable UnsupportedOperationException

2020-06-01 Thread Sven Meier
+1 that should have no negative impact Sven On 01.06.20 11:22, Martin Grigorov wrote: Hi, I like the idea to catch UnsupportedOperationException at org.apache.wicket.IGenericComponent#setModelObject(T) and re-throw it as: throw new WicketRuntimeException("You need to use read/write Model for c

Re: Locatable UnsupportedOperationException

2020-06-01 Thread Martin Grigorov
Hi, I like the idea to catch UnsupportedOperationException at org.apache.wicket.IGenericComponent#setModelObject(T) and re-throw it as: throw new WicketRuntimeException("You need to use read/write Model for component '{}", this.getPageRelativePath(), uox) Does anyone see a drawback ? Martin On

Re: Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread Sven Meier
Hi, you have to use a new FormTester instance after executing the Ajax event: ...     formTester = tester.newFormTester(path)     formTester.select("field1", ""); // required field     formTester.select("field2", ""); // required field     .     formTester

Executing AjaxEvent reset form inputs during Wicket test

2020-06-01 Thread leodali83
Hello everybody, I'm developing a web application built on Wicket 8. Now i'm testing a form containing 2 DropDownChoice, the selection of the first one should refresh elements to be choose on the second through the Ajax "change" event. When i submit my form and I test feedback messages displayed d