wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Meier <s...@meiers.net>
Subject Re: Opening a stateful page in a new window/tab with ajax
Date Thu, 21 Nov 2019 16:38:42 GMT
Hi,

that's a perfectly valid usage.

Have fun
Sven


On 21.11.19 13:44, mscoon wrote:
> Hi all,
>
> We are using the following code inside an ajax callback to create a new
> page and open it in a new window. Are there any gotchas with respect to how
> we create MyPage and get the url for it? Is it guaranteed to be found in
> the user's session when the request for it comes in?
>
> void openPageInNewWindow(AjaxRequestTarget target) {
>      Page pg = new MyPage();
>      String url = urlFor(new RenderPageRequestHandler(new
> PageProvider(pg))).toString();
>       target.appendJavaScript("window.open(\"" + url + "\")");
> }
>
> Is there a better way to do this?
>
> Note that we don't want to use a BookmarkablePage page as an alternative.
> We want the new page to be instantiated inside the ajax callback.
>
> Thank you in advance,
> Marios
>

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


Mime
View raw message