You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/03/01 11:11:42 UTC

[1/2] git commit: WICKET-4435 UploadProgressBar won't update while uploading if CryptoMapper is used as RootRequestMapper

Updated Branches:
  refs/heads/wicket-1.5.x 887f2608a -> af37e51a0


WICKET-4435 UploadProgressBar won't update while uploading if CryptoMapper is used as RootRequestMapper

Set no-cache headers instead of concatenating anticache parameter in .js (this breaks when CryptoMapper is used)


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/af37e51a
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/af37e51a
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/af37e51a

Branch: refs/heads/wicket-1.5.x
Commit: af37e51a0db793184678b2c7e76b2e070ea8ffdb
Parents: 56db240
Author: martin-g <mg...@apache.org>
Authored: Thu Mar 1 12:10:13 2012 +0200
Committer: martin-g <mg...@apache.org>
Committed: Thu Mar 1 12:10:13 2012 +0200

----------------------------------------------------------------------
 .../html/form/upload/UploadStatusResource.java     |    2 ++
 .../ajax/markup/html/form/upload/progressbar.js    |    9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/af37e51a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java
index f76bfcf..0083d45 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/UploadStatusResource.java
@@ -26,6 +26,7 @@ import org.apache.wicket.protocol.http.servlet.MultipartServletWebRequestImpl;
 import org.apache.wicket.protocol.http.servlet.UploadInfo;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.time.Duration;
 
 /**
  * A resource that prints out basic statistics about the current upload. This resource is used to
@@ -62,6 +63,7 @@ class UploadStatusResource extends AbstractResource
 
 		ResourceResponse response = new ResourceResponse();
 		response.setContentType("text/html; charset=" + encoding);
+		response.setCacheDuration(Duration.NONE);
 
 		final String status = getStatus(attributes);
 		response.setWriteCallback(new WriteCallback()

http://git-wip-us.apache.org/repos/asf/wicket/blob/af37e51a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
index 9df4347..3f08977 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js
@@ -65,7 +65,7 @@ Wicket.WUPB.prototype = {
 		if( oldLabel != null){
 			Wicket.$(this.statusid).removeChild(oldLabel);
 		}
-		Wicket.$(this.statusid).appendChild(label);		
+		Wicket.$(this.statusid).appendChild(label);
 	},
 	
 	setPercent : function(progressPercent){
@@ -77,7 +77,7 @@ Wicket.WUPB.prototype = {
 	},
 
 	load : function() {
-		var URL = this.url + '&anticache=' + Math.random();
+		var URL = this.url;
 		
     	this.iframe = Wicket._createIFrame(""+Math.random());
 		
@@ -88,11 +88,12 @@ Wicket.WUPB.prototype = {
 	},
 
 	update : function() {
+		var responseAsText;
 		if(this.iframe.contentDocument){
-			var responseAsText = this.iframe.contentDocument.body.innerHTML;
+			responseAsText = this.iframe.contentDocument.body.innerHTML;
 		}else{
 			// for IE 5.5, 6 and 7:
-			var responseAsText = this.iframe.contentWindow.document.body.innerHTML
+			responseAsText = this.iframe.contentWindow.document.body.innerHTML
 		}
 		
 		var update = responseAsText.split('|');