You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by lucast <lu...@hotmail.com> on 2014/06/24 17:35:59 UTC

TDD - ajax button form submit via FormTester - Wicket 6

Dear Forum,
I am testing a form with has fields with ajax behaviours and form
components. The form has an ajax submit button to do all the necessary
processing.

Initially half of the form fields are hidden.

I then select a drop down list with has an OnChangeAjaxBehavior attached to
it in order to make the necessary fields visible and some, required.

I do it thus:



I then go on to set values on every field on form, including the ones nested
inside formComponents. Here are a few examples:



Finally, I submit the form, which is where the issue lies.

Initially I was calling 
 

But I came to the conclusion that if I am using an ajax button I should call
tester.executeAjaxEvent. Therefore I have placed the following line before
the formTester.submit() call.


When I call  it returns true. And after iterating through the code with the
debugger, some of the required fields have the following feedback messages:



Why would the above behaviour occur? What am I missing in order to make a
successful form submit?

I am really at a loss, since I have populated the necessary fields, as shown
on examples above.

Thanks in advance,
Lucas 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/TDD-ajax-button-form-submit-via-FormTester-Wicket-6-tp4666367.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: TDD - ajax button form submit via FormTester - Wicket 6

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

See https://issues.apache.org/jira/browse/WICKET-5575

Martin Grigorov
Wicket Training and Consulting


On Tue, Jun 24, 2014 at 6:35 PM, lucast <lu...@hotmail.com> wrote:

> Dear Forum,
> I am testing a form with has fields with ajax behaviours and form
> components. The form has an ajax submit button to do all the necessary
> processing.
>
> Initially half of the form fields are hidden.
>
> I then select a drop down list with has an OnChangeAjaxBehavior attached to
> it in order to make the necessary fields visible and some, required.
>
> I do it thus:
>
>
>
> I then go on to set values on every field on form, including the ones
> nested
> inside formComponents. Here are a few examples:
>
>
>
> Finally, I submit the form, which is where the issue lies.
>
> Initially I was calling
>
>
> But I came to the conclusion that if I am using an ajax button I should
> call
> tester.executeAjaxEvent. Therefore I have placed the following line before
> the formTester.submit() call.
>
>
> When I call  it returns true. And after iterating through the code with the
> debugger, some of the required fields have the following feedback messages:
>
>
>
> Why would the above behaviour occur? What am I missing in order to make a
> successful form submit?
>
> I am really at a loss, since I have populated the necessary fields, as
> shown
> on examples above.
>
> Thanks in advance,
> Lucas
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/TDD-ajax-button-form-submit-via-FormTester-Wicket-6-tp4666367.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>