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/19 09:59:30 UTC

Bug in modal window.onBeforeRender <-> tests

Hi!

For some reason ModalWindow assumes request is not ajax even though it
is clicked via executeAjaxEvent:
		if (getWebRequest().isAjax() == false)
		{
			shown = false; // This hides the button
		}

Thread [main] (Suspended (breakpoint at line 3191 in Component))	
	SettingsModalPanelContents$8$3$1(Component).setVisible(boolean) line: 3191	
	ModalWindow.onBeforeRender() line: 820	
	ModalWindow(Component).internalBeforeRender() line: 1061	
	ModalWindow(Component).beforeRender() line: 1095	
	RedirectPageRequestTarget(PageRequestTarget).respond(RequestCycle) line: 63	
	WicketTester(MockWebApplication).postProcessRequestCycle(WebRequestCycle)
line: 558
	WicketTester(MockWebApplication).processRequestCycle(WebRequestCycle)
line: 517
	WicketTester(BaseWicketTester).executeAjaxEvent(Component, String) line: 1233	
	WicketTester(BaseWicketTester).executeAjaxEvent(String, String) line: 1109	
	TestSettings.testModalSettings() line: 157	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available	
	Method.invoke(Object, Object...) line: not available	

So the test fails with no good reason when the modal window assumes it
is not visible.

Basically what the test does is the following:
1. submit form
2. click links
3. executeajaxevent
4. submit form
5. executeajaxevent to open modal window
6. exceuteajaxevent on a button on the modal window <fails>

I found a workaround by placing "tester.setupRequestAndResponse()"
just before line 5. Ofcourse a true fix would we nice.

**
Martin

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


Re: Bug in modal window.onBeforeRender <-> tests

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
I am working on reproducing it via steps 1-6.

**
Martin

2009/7/19 Per Lundholm <pe...@gmail.com>:
> Was it your intention to attach some code?
>
> /Per
>

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


Re: Bug in modal window.onBeforeRender <-> tests

Posted by Per Lundholm <pe...@gmail.com>.
Was it your intention to attach some code?

/Per

On Sun, Jul 19, 2009 at 9:59 AM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:
> Hi!
>
> For some reason ModalWindow assumes request is not ajax even though it
> is clicked via executeAjaxEvent:
>                if (getWebRequest().isAjax() == false)
>                {
>                        shown = false; // This hides the button
>                }
>
> Thread [main] (Suspended (breakpoint at line 3191 in Component))
>        SettingsModalPanelContents$8$3$1(Component).setVisible(boolean) line: 3191
>        ModalWindow.onBeforeRender() line: 820
>        ModalWindow(Component).internalBeforeRender() line: 1061
>        ModalWindow(Component).beforeRender() line: 1095
>        RedirectPageRequestTarget(PageRequestTarget).respond(RequestCycle) line: 63
>        WicketTester(MockWebApplication).postProcessRequestCycle(WebRequestCycle)
> line: 558
>        WicketTester(MockWebApplication).processRequestCycle(WebRequestCycle)
> line: 517
>        WicketTester(BaseWicketTester).executeAjaxEvent(Component, String) line: 1233
>        WicketTester(BaseWicketTester).executeAjaxEvent(String, String) line: 1109
>        TestSettings.testModalSettings() line: 157
>        NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
> available [native method]
>        NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
>        DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
>        Method.invoke(Object, Object...) line: not available
>
> So the test fails with no good reason when the modal window assumes it
> is not visible.
>
> Basically what the test does is the following:
> 1. submit form
> 2. click links
> 3. executeajaxevent
> 4. submit form
> 5. executeajaxevent to open modal window
> 6. exceuteajaxevent on a button on the modal window <fails>
>
> I found a workaround by placing "tester.setupRequestAndResponse()"
> just before line 5. Ofcourse a true fix would we nice.
>
> **
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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