You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kyc <br...@hku.hk> on 2019/03/07 06:56:00 UTC

ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

Our page open a WindowModal for editing a form, there is an exception throw
when closed the modal window.
This problem only happens when our site is using NoPageStore but we have to
use NoPageStore.

The following exception happen and the setWindowClosedCallback cannot be
called.
Page with id '16' has expired.
org.apache.wicket.protocol.http.PageExpiredException: Page with id '16' has
expired.


The modal window close call back function works on without NoPageStore
setting:

	        abcModalWindow.setWindowClosedCallback(new WindowClosedCallback() {
				private static final long serialVersionUID = 7961678233294274184L;

				public void onClose(AjaxRequestTarget target) {
					doRefresh(target);
	            }
	        });

Please help if anyone knows the solution.  Thanks a lot.


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

Posted by kyc <br...@hku.hk>.
Why AjaxButton works inside the modal window ModalEditPanel but Button not
works for the Form submit?

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

Posted by kyc <br...@hku.hk>.
	        modalEditLog.setContent(new
ModalEditPanel(modalEditLog.getContentId(), modalEditLog, result));
	        
	        
	        modalEditLog.setWindowClosedCallback(new WindowClosedCallback() {
				private static final long serialVersionUID = 7961678233294274184L;

				public void onClose(AjaxRequestTarget target) {
					doRefresh(target);
	            }
	        });


Panel ModalEditPanel is the replacement for the original WebPage
ModalEditPage and it has the close button to close the window

		addOrReplace(new AjaxLink<T>("btnClose") {
				private static final long serialVersionUID = -8174543450190822811L;

				@Override
	            public void onClick(AjaxRequestTarget target) {
	                window.close(target);
	            }
	        });


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

Posted by Martin Grigorov <mg...@apache.org>.
Please share how you solved it.
Someone else may hit the same issue some day and your explicit description
will help him/her.
Just confirming "ModalWindow#setContent() solved it" is also fine.

On Thu, Mar 7, 2019 at 11:52 AM kyc <br...@hku.hk> wrote:

> Solved.  Thank you.
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

Posted by kyc <br...@hku.hk>.
Solved.  Thank you.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

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

It seems you use ModalWindow backed by a Page, i.e. you use ModalWindow's
PageCreator.
Try with ModalWindow backed by a Panel (ModalWindow#setContent()).

On Thu, Mar 7, 2019 at 9:57 AM kyc <br...@hku.hk> wrote:

> Hi Bas,
>
> Thanks for your reply.
>
> Since we are saving data in the page of Modal Page itself, it is no
> problem.
> However,  we have problem to close that modalwindow with a separate close
> button.
> Even I change the form to StatelessForm, the close button still have the
> PageExpiredException
>
>                         addOrReplace(new AjaxLink<T>("btnClose") {
>                                 private static final long serialVersionUID
> = -8174543450190822811L;
>
>                                 @Override
>                     public void onClick(AjaxRequestTarget target) {
>                         window.close(target);
>                     }
>                 });
>
> KYC
>
>
>
>
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

Posted by kyc <br...@hku.hk>.
Hi Bas,

Thanks for your reply.

Since we are saving data in the page of Modal Page itself, it is no problem.
However,  we have problem to close that modalwindow with a separate close
button.  
Even I change the form to StatelessForm, the close button still have the
PageExpiredException

			addOrReplace(new AjaxLink<T>("btnClose") {
				private static final long serialVersionUID = -8174543450190822811L;

				@Override
	            public void onClick(AjaxRequestTarget target) {
	                window.close(target);
	            }
	        });

KYC





--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: ModalWindow cannot trigger setWindowClosedCallback or setCloseButtonCallback problem

Posted by Bas Gooren <ba...@iswd.nl>.
Hi,

Since you are not storing pages, how does the form in your modal
window work? I assume you are using a stateless form?

Since your on close callback is stateful, it will not work; you will
either need to use a stateless Ajax behavior or stateless form where
in onsubmit you redirect to a new page with up-to-date information.

// Bas

Verstuurd vanaf mijn iPhone

> Op 7 mrt. 2019 om 07:56 heeft kyc <br...@hku.hk> het volgende geschreven:
>
> Our page open a WindowModal for editing a form, there is an exception throw
> when closed the modal window.
> This problem only happens when our site is using NoPageStore but we have to
> use NoPageStore.
>
> The following exception happen and the setWindowClosedCallback cannot be
> called.
> Page with id '16' has expired.
> org.apache.wicket.protocol.http.PageExpiredException: Page with id '16' has
> expired.
>
>
> The modal window close call back function works on without NoPageStore
> setting:
>
>            abcModalWindow.setWindowClosedCallback(new WindowClosedCallback() {
>                private static final long serialVersionUID = 7961678233294274184L;
>
>                public void onClose(AjaxRequestTarget target) {
>                    doRefresh(target);
>                }
>            });
>
> Please help if anyone knows the solution.  Thanks a lot.
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> 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