You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by kn...@apache.org on 2007/08/26 17:10:25 UTC

svn commit: r569824 - in /wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal: ModalWindow.java res/modal.js

Author: knopp
Date: Sun Aug 26 08:10:24 2007
New Revision: 569824

URL: http://svn.apache.org/viewvc?rev=569824&view=rev
Log:
WICKET-536

Modified:
    wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
    wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js

Modified: wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java?rev=569824&r1=569823&r2=569824&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java (original)
+++ wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/ModalWindow.java Sun Aug 26 08:10:24 2007
@@ -34,6 +34,7 @@
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.markup.html.resources.CompressedResourceReference;
 import org.apache.wicket.markup.html.resources.JavascriptResourceReference;
+import org.apache.wicket.protocol.http.WebRequest;
 import org.apache.wicket.request.RequestParameters;
 import org.apache.wicket.settings.IPageSettings;
 import org.apache.wicket.util.lang.EnumeratedType;
@@ -731,6 +732,12 @@
 	protected void onBeforeRender()
 	{
 		super.onBeforeRender();
+		
+		// if user is refreshing whole page, the window will not be shown 
+		if (((WebRequest)getRequest()).isAjax() == false) {
+			shown = false;
+		}
+		
 		getContent().setOutputMarkupId(true);
 		getContent().setVisible(shown);
 	}

Modified: wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js?rev=569824&r1=569823&r2=569824&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js (original)
+++ wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js Sun Aug 26 08:10:24 2007
@@ -570,8 +570,15 @@
 			this.update = window.setInterval(this.updateTitle.bind(this), 100);
 		
 		this.content.src = this.settings.src;
-
-		this.content.contentWindow.name = this.settings.iframeName;
+	
+		// opera seems to have problem accessing contentWindow here
+		if (Wicket.Browser.isOpera()) {
+			this.content.onload = function() {
+				this.content.contentWindow.name = this.settings.iframeName;
+			}
+		} else {
+			this.content.contentWindow.name = this.settings.iframeName;
+		}
 	},
 	
 	/**