You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nelson Segura <ns...@gmail.com> on 2012/01/02 19:24:21 UTC

Re: ModalWindow does not close cleanly

Any hope this can be fixed for 1.5.4? I will hate having to change all
our modals to have a dummy call back to get it to work :(
-Nelson

On Wed, Dec 21, 2011 at 2:59 PM, Nelson Segura <ns...@gmail.com> wrote:
> I have created a ticket, and attached a quick start to it
>
> https://issues.apache.org/jira/browse/WICKET-4311
>
> Notice that if you uncomment the dummy callback code, you will be able
> to reopen the modal.

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


Re: ModalWindow does not close cleanly

Posted by Nelson Segura <ns...@gmail.com>.
I noticed also that if I add a dummy window closed call back to my page:

1) In the modal window, calling window.close() sets the "shown" flag to false
2) My dummy callback causes ModalWindow.WindowClosedBehavior to
respond. The current value of this shown flag is still true! Then the
behavior sets it to false again.

I believed that calling "window.close()" from inside a window that
uses page does not close the window cleanly.

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


Re: ModalWindow does not close cleanly

Posted by Andrea Del Bene <an...@gmail.com>.
On 01/03/2012 12:30 AM, Nelson Segura wrote:
>   The "shown" flag is set up to false by window.close(), but it stays as true in the
> context of the parent page. This prevents the page from being opened a
> second time. Maybe something similar to how you cannot pass pages
> directly to a modal, but instead should pass a page reference.
I agree with you. Your problem seems very similar to the one of passing 
page to modal.
I think this issue has to do with page serialization: when we try to 
open modal window a second time, Wicket uses the "old" versions of both 
main page and modal window where "shown" flag is true.


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


Re: ModalWindow does not close cleanly

Posted by Nelson Segura <ns...@gmail.com>.
:) A patch will be nice, but ... I think this has to do with my modal
window using page instead of panel. Could it be?

The window clears up the "shown" flag correctly if I press in the "x"
for the modal window, because the CloseButtonBehavior gets called, but
then the Ajax Target being used is in the context of the parent page.
The "x" icon sits outside the window.

My close/cancel button is calling window.close() directly, but that is
being executed inside the context of the modal page. The "shown" flag
is set up to false by window.close(), but it stays as true in the
context of the parent page. This prevents the page from being opened a
second time. Maybe something similar to how you cannot pass pages
directly to a modal, but instead should pass a page reference.
If I provide a dummy WindowClosedCallback, then the flag gets clear in
the context of the parent page.

I don't know if what I am saying is clear or correct, but I don't
exactly know where to start to fix this :(

-nelson

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


Re: ModalWindow does not close cleanly

Posted by Igor Vaynberg <ig...@gmail.com>.
a patch is welcome :)

-igor

On Mon, Jan 2, 2012 at 10:24 AM, Nelson Segura <ns...@gmail.com> wrote:
> Any hope this can be fixed for 1.5.4? I will hate having to change all
> our modals to have a dummy call back to get it to work :(
> -Nelson
>
> On Wed, Dec 21, 2011 at 2:59 PM, Nelson Segura <ns...@gmail.com> wrote:
>> I have created a ticket, and attached a quick start to it
>>
>> https://issues.apache.org/jira/browse/WICKET-4311
>>
>> Notice that if you uncomment the dummy callback code, you will be able
>> to reopen the modal.
>
> ---------------------------------------------------------------------
> 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