Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6667763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:58:04+00:00 2026-05-26T02:58:04+00:00

My GWT app is being added to an iframe. I have a button in

  • 0

My GWT app is being added to an iframe. I have a button in the app which then should direct to another page. Currently, I’m doing it like this:

Window.Location.assign("http://testpage.com");

The problem right now is that new page is being loaded into the iframe. Is there a way to reload the whole page to avoid having that effect?

I have read some posts here on stackoverflow but none of them where in GWT. I hope someone already had the problem and solved it successfully.

Thanks for any advices!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:58:04+00:00Added an answer on May 26, 2026 at 2:58 am

    I don’t believe GWT has a built in function you can call for this.

    The usual idiom in JavaScript to do this looks like this

    if (top.location!= self.location) {    //test if in an iframe
        top.location = self.location.href; //if so, break out
    }
    

    This won’t work directly in GWT, though you could put it in your main html page, probably in the <head> before the rest of the app loads – this will kick you out of the iframe right away instead of waiting for the app to load, breaking out, then waiting for the app to load again.

    If you really want to run the check in GWT, perhaps because you only sometimes want to break out, you’ll need a very short JSNI method to add this feature, something like this:

    public native void breakOut() /*-{
        if ($wnd.top.location != $wnd.location) {
            $wnd.top.location = $wnd.location.href;
        }
    }-*/
    

    Note the use of $wnd to refer to the app’s window object. See http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html for more details on writing JSNI. Do not expect this function to return – it is triggering the browser to unload this page and load another.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple host page for a GWT app with an input button
I have this gwt app which say, runs on http://mygwtapp.com/ (which is actually: http://mygwtapp.com/index.html
Hi I have this code in my gwt app which purpose is to chage
In my GWT app I have the following model class: import com.google.gwt.user.client.rpc.IsSerializable; public class
I have a GWT app that makes an RPC call to a server to
I have a gwt app that requires GWT Recaptcha for one of its part.
I have a typical GWT app, in my module.xml, I have, <inherits name='com.google.gwt.user.theme.standard.Standard' />
We have a GWT app that has multiple screens, based off of a menu.
I have a GWT app with a bunch of textboxes. In firefox I would
What I am want to do is really simple. I have an gwt app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.