You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Makundi <ma...@koodaripalvelut.com> on 2009/07/11 11:21:10 UTC

Bug in BaseWicketTester ajax submit?

Hi!

The following code (1.4-rc6):
		// We need to get the form submitted, using reflection.
		// It needs to be "submitted".
		Form<?> form = null;
		try
		{
			Field formField = AjaxFormSubmitBehavior.class.getDeclaredField("__form");
			formField.setAccessible(true);
			form = (Form<?>)formField.get(behavior);
		}
		catch (Exception e)

fails when AjaxButton is declared with implicite form. Probably the
above code should use the getForm() method?

**
Martin

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


Re: Bug in BaseWicketTester ajax submit?

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!

Actually the bug is that it is totally fine to call
tester.executeAjaxEvent on a button that is not visible :)

Nevertheless... just calling getForm() could be simpler?

I reported bug in jira: https://issues.apache.org/jira/browse/WICKET-2363

**
Martin

2009/7/11 Martin Makundi <ma...@koodaripalvelut.com>:
> Hi!
>
> The following code (1.4-rc6):
>                // We need to get the form submitted, using reflection.
>                // It needs to be "submitted".
>                Form<?> form = null;
>                try
>                {
>                        Field formField = AjaxFormSubmitBehavior.class.getDeclaredField("__form");
>                        formField.setAccessible(true);
>                        form = (Form<?>)formField.get(behavior);
>                }
>                catch (Exception e)
>
> fails when AjaxButton is declared with implicite form. Probably the
> above code should use the getForm() method?
>
> **
> Martin
>

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