]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix: Force browser to fire unload event when component is detached from the view...
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Thu, 3 Apr 2008 09:47:26 +0000 (09:47 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Thu, 3 Apr 2008 09:47:26 +0000 (09:47 +0000)
svn changeset:4126/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IEmbedded.java

index 50b3c3cfe40ab6086bb3b58c8109101d6d1f3ea1..7c271179444a4da362c4d389bec0b7cb724dfe74 100644 (file)
@@ -73,7 +73,7 @@ public class IEmbedded extends HTML implements Paintable {
      * @return
      */
     private String getSrc(UIDL uidl, ApplicationConnection client) {
-        String url =  client.translateToolkitUri(uidl.getStringAttribute("src"));
+        String url = client.translateToolkitUri(uidl.getStringAttribute("src"));
         if (url == null) {
             return "";
         }
@@ -95,4 +95,13 @@ public class IEmbedded extends HTML implements Paintable {
         heigth = height;
         super.setHeight(height);
     }
+
+    protected void onDetach() {
+        // Force browser to fire unload event when component is detached from
+        // the view (IE doesn't do this automatically)
+        if (browserElement != null) {
+            DOM.setElementAttribute(browserElement, "src", "javascript:false");
+        }
+        super.onDetach();
+    }
 }