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 6692151
In Process

The Archive Base Latest Questions

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

I have a GWT application that features two frames (com.google.gwt.user.client.ui.Frame). Via Frame.setUrl(…) I can

  • 0

I have a GWT application that features two frames (com.google.gwt.user.client.ui.Frame). Via Frame.setUrl(…) I can load arbitrary web pages without any problems. Of course, user then can click on links on the loaded pages, which in turn load the corresponding pages? How can I keep track of the currently loaded pages in both frames?

Below are my current attempt using two types of listeners; I found the code snippets on the Web. Both events fire, but still I don’t know how to get the current loaded URL

import com.google.gwt.event.dom.client.LoadEvent;
import com.google.gwt.event.dom.client.LoadHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
import com.google.gwt.user.client.ui.Frame;

public class BrowserTabFrame extends Frame implements EventListener {

 public BrowserTabFrame() {
    super();
    sinkEvents(Event.ONLOAD);

    addLoadHandler(new LoadHandler() {      
        @Override
        public void onLoad(LoadEvent event) {
            System.out.println(event.getSource());
            // <iframe style="visibility: visible;" id="ext-gen17" src="http://..." class="gwt-Frame"></iframe>
            // however, the src attribute never changes
        }
    });
  }

  @Override
  public void onBrowserEvent(Event event) {
    super.onBrowserEvent(event);
    if (DOM.eventGetType(event) == Event.ONLOAD) 
        System.out.println(event.getCurrentEventTarget());
        // [object HTMLIFrameElement]
        // no idea what to do with it   
  }
}

Thanks for any hints!

Christian

  • 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-26T05:50:05+00:00Added an answer on May 26, 2026 at 5:50 am

    The src attribute of an iframe will never change but the URL property of the contained document will. You can get this value using JSNI:

    private native String getIframeUrl(IFrameElement frame) /*-{
      if (frame.contentDocument !== undefined) {
        return frame.contentDocument.URL;
      } else if (frame.contentWindow !== undefined &&
                 frame.contentWindow.document !== undefined)
      {
        return frame.contentWindow.document;
      } else {
        return null;
      }
    }-*/;
    
    ...
    
    Window.alert(getIframeUrl(myFrame.getElement()));
    

    However note that, if the security context (any of protocol, domain or port number) of the iframe changes, the browser will not allow the containing application to access the document in the frame.

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

Sidebar

Related Questions

I have a web application that I developed with the Google Web Toolkit (GWT),
I have a GWT application that accept these tokens: http://127.0.0.1:8888/app.html?gwt.codesvr=127.0.0.1:9997#user&someuser This will open up
I have an AWT applet application that needs to be ported over to GWT.
We have a GWT application that needs to display various holidays. Is there a
I have a simple java applet that is invoked from gwt application. Is there
I have gwt web project, which must use application.properties (on client side) loaded as
I have an application that uses gwt-dnd to make boxes draggable, but when there
I have a view that I created in my GWT application and I would
I have a GWT application that created an XML structure and then posts this
I have a GWT application that I want to release as software-as-a-service (SAAS) on

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.