You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by sorinev <so...@gmail.com> on 2018/05/11 17:42:24 UTC

iframe on migration from 1.4.17 to 7.10.0

FYI: I did not write the original code; I'm just updating it.

We have an application on 1.4.17 that we are /finally/ updating to 7 (like
I've been saying is necessary for the last 3 years, but now a client wants
us to do it and suddenly it's urgent...) and have things mostly sorted out.
One of the few remaining issues is some iframe functionality that we have.
As a part of our base page (which all pages extend) we have a link in the
bottom right that, when clicked, slides open an iframe with content in it
specific to the current page. It looks like this in the 1.4.17 version:

Java:
WebMarkupContainer help_src = new WebMarkupContainer("help_src");
help_src.add(new SimpleAttributeModifier("src", getHelpLinkPath()));
add(help_src);

HTML:
<div id="slider">
	<div id="tab">Help</div>
	<iframe wicket:id="help_src" style="width: 100%; height: 100%; border:
0px"></iframe>
</div>

When viewing the source of the page and looking at the generated URL in the
src of the iframe, it looks like this:

https://ip/myApp/Help/Admin/index.html

When clicked, it shows the content of the pointed-to page.

Now, after fixing the build errors for the 7.10.0 upgrade, the Java and HTML
look the same, save for the update for the way AttributeModifier works (not
important here). Now however, the URL looks like this:

https://ip/myApp/wicket/Help/Admin/index.html

When clicked, the frame is empty and the source pointed to is just a
[browser?] generated error page.

Notice the addition of the "/wicket/" bit in the URL. We haven't done any
page mounting in the entry point (WicketApplication.java class). Where is
this coming from? If I simply add a "wicket" folder to the root of our .war
and move the "Help" directory there, it works. But isn't the "wicket" folder
a temporary thing generated upon running? Or is it not, and there's just
something in our code related to the 7.10.0 update indirectly causing that
to get added to the URL?

--
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: iframe on migration from 1.4.17 to 7.10.0

Posted by Sven Meier <sv...@meiers.net>.
If your application is published in "myapp" context, that must be prefixed too.

You should pass all your context absolute urls to UrlRenderer. Sorry I don't have the API here right now but something like getUrlRenderer().renderContexrRelative(contextRelativeBeginningWithSlash)

Have fun
Sven

Am 11. Mai 2018 23:35:09 MESZ schrieb sorinev <so...@gmail.com>:
>Thanks, that was basically it, though I had to prefix with "/myApp/"
>instead.
>Is there a way to set this globally somewhere through Wicket itself,
>rather
>than making sure all my strings have that prefixed?
>
>--
>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: iframe on migration from 1.4.17 to 7.10.0

Posted by sorinev <so...@gmail.com>.
Thanks, that was basically it, though I had to prefix with "/myApp/" instead.
Is there a way to set this globally somewhere through Wicket itself, rather
than making sure all my strings have that prefixed?

--
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: iframe on migration from 1.4.17 to 7.10.0

Posted by Sven Meier <sv...@meiers.net>.
Hi,

check the url of your page:

Wicket 7 all your pages are requested with path "/wicket/", when in 1.4 
they where all on "/" (with a "?wicket:" request parameter).
Since your help paths are relative, the browser interprets them relative 
to the current page, i.e. "/wicket/Help/Device/add.html".

You'll have to make that help paths absolute, in your case prefixing a 
slash "/" should be an easy fix for now.

Have fun
Sven


Am 11.05.2018 um 22:21 schrieb sorinev:
> It's different for each page, but it returns a string that corresponds to the
> path in the "Help" folder to find the help page associated with the current
> page. The AtrributeModifier then replaces the src attribute of the help
> iframe so that when clicked, it slides up the help page relevant to the
> current application page. So if you are on a page to add a new device, then
> getHelpPath() would return a string like "Help/Device/add.html", which is a
> path that is relative to the root of the application war folder. So
> {war-root}/Help/Device/add.html. Except that with Wicket 7, extra things are
> getting added to the url.
>
> So in 1.4.17, the src link would be "Help/Device/add.html", and then a
> mousover of the link shows the full url is the application root,
> https://ip/myApp" added together with the current src string, so
> https://ip/myApp/Help/Device/add.html.
>
> However, in 7.10.0, the part of the url that comes before the help path
> string now has things added to it. Some times it's wicket and sometimes it's
> bookmarkable. So, https://ip/myApp/*wicket/*Help/Device/add.html or
> https://ip/myApp/*wicket/bookmarkable/*Help/Device/add.html.
>
> I'm not sure where that's coming from.
>
> --
> 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


Re: iframe on migration from 1.4.17 to 7.10.0

Posted by sorinev <so...@gmail.com>.
It's different for each page, but it returns a string that corresponds to the
path in the "Help" folder to find the help page associated with the current
page. The AtrributeModifier then replaces the src attribute of the help
iframe so that when clicked, it slides up the help page relevant to the
current application page. So if you are on a page to add a new device, then
getHelpPath() would return a string like "Help/Device/add.html", which is a
path that is relative to the root of the application war folder. So
{war-root}/Help/Device/add.html. Except that with Wicket 7, extra things are
getting added to the url.

So in 1.4.17, the src link would be "Help/Device/add.html", and then a
mousover of the link shows the full url is the application root,
https://ip/myApp" added together with the current src string, so
https://ip/myApp/Help/Device/add.html.

However, in 7.10.0, the part of the url that comes before the help path
string now has things added to it. Some times it's wicket and sometimes it's
bookmarkable. So, https://ip/myApp/*wicket/*Help/Device/add.html or
https://ip/myApp/*wicket/bookmarkable/*Help/Device/add.html.

I'm not sure where that's coming from.

--
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: iframe on migration from 1.4.17 to 7.10.0

Posted by Sven Meier <sv...@meiers.net>.
Hi,

what does getHelpLinkPath() look like?

Have fun
sven


Am 11.05.2018 um 19:42 schrieb sorinev:
> FYI: I did not write the original code; I'm just updating it.
>
> We have an application on 1.4.17 that we are /finally/ updating to 7 (like
> I've been saying is necessary for the last 3 years, but now a client wants
> us to do it and suddenly it's urgent...) and have things mostly sorted out.
> One of the few remaining issues is some iframe functionality that we have.
> As a part of our base page (which all pages extend) we have a link in the
> bottom right that, when clicked, slides open an iframe with content in it
> specific to the current page. It looks like this in the 1.4.17 version:
>
> Java:
> WebMarkupContainer help_src = new WebMarkupContainer("help_src");
> help_src.add(new SimpleAttributeModifier("src", getHelpLinkPath()));
> add(help_src);
>
> HTML:
> <div id="slider">
> 	<div id="tab">Help</div>
> 	<iframe wicket:id="help_src" style="width: 100%; height: 100%; border:
> 0px"></iframe>
> </div>
>
> When viewing the source of the page and looking at the generated URL in the
> src of the iframe, it looks like this:
>
> https://ip/myApp/Help/Admin/index.html
>
> When clicked, it shows the content of the pointed-to page.
>
> Now, after fixing the build errors for the 7.10.0 upgrade, the Java and HTML
> look the same, save for the update for the way AttributeModifier works (not
> important here). Now however, the URL looks like this:
>
> https://ip/myApp/wicket/Help/Admin/index.html
>
> When clicked, the frame is empty and the source pointed to is just a
> [browser?] generated error page.
>
> Notice the addition of the "/wicket/" bit in the URL. We haven't done any
> page mounting in the entry point (WicketApplication.java class). Where is
> this coming from? If I simply add a "wicket" folder to the root of our .war
> and move the "Help" directory there, it works. But isn't the "wicket" folder
> a temporary thing generated upon running? Or is it not, and there's just
> something in our code related to the 7.10.0 update indirectly causing that
> to get added to the URL?
>
> --
> 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