Bug in modal window.onBeforeRender <-> tests

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in modal window.onBeforeRender <-> tests

Martin Makundi
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Per Lundholm
Was it your intention to attach some code?

/Per

On Sun, Jul 19, 2009 at 9:59 AM, Martin
Makundi<[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Martin Makundi
I am working on reproducing it via steps 1-6.

**
Martin

2009/7/19 Per Lundholm <[hidden email]>:
> Was it your intention to attach some code?
>
> /Per
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]