Force url to open in Parent Window

Hi,

I have lot’s of Xojo web apps and they all run in a frame so they appear to be part of our web site. I need to send them to a page that is part of the web site, so the page with the frame closes and is replaced by a normal page?

How can you do that from inside of a Xojo app?

Thanks

The LR is your friend :
http://documentation.xojo.com/index.php/WebControl.ShowURL

With a WebLink you can set the Target to be the window, WebLink.Target
WebSession.ShowURL only appears to have a setting to open a new window.

If someone doesn’t chime in with a Xojo code way to do it, you can use Javascript:

ExecuteJavascript("top.location.href = 'http://htmledit.timi.me';")

That opens it in a new tab, I want it in the same tab.

Btw fastest response on record!

You mean you want the app to show out of the iframe ? I don’t know any way to switch without creating a new session.

The best I can think of is to enlarge the iframe so it covers 100vh x 100vw. Easily achievable in JavaScript.

@Tim Parnell

The JavaScript doesn’t work.

How do you use the WebLink.target?

@Michel Bujardet

Enlarging the frame would work, we would have our website embedded in a frame. Its to get them back to the parent window.

It does work, I’ve just tested it (and went way out of my way to do so lol.)
To change a WebLink target you can use either the IDE or code to set that property.

Thanks

I’ll look at my test again. Won’t be till tomorrow.

What is the Weblink a property of?

I’m confused.

WebLinks are controls for the page.
http://documentation.xojo.com/index.php/WebLink

Example project:
ExitFrame.xojo_binary_project

The Weblink won’t work as it has to be fired by a timer.

Thanks for all your help.

Got it and it works!

The reason it didn’t work the first time was it wasn’t entered correctly: ExecuteJavascript(“window.location = ‘http://aspe.org’;”)

Thanks again for going above and beyond. It’s guys like you that give Xojo community good name.