summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/VAADIN/vaadinBootstrap.js8
-rw-r--r--src/com/vaadin/terminal/CombinedRequest.java4
-rw-r--r--src/com/vaadin/terminal/WrappedRequest.java8
3 files changed, 20 insertions, 0 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js
index b61c10dcf7..9a7a9d3569 100644
--- a/WebContent/VAADIN/vaadinBootstrap.js
+++ b/WebContent/VAADIN/vaadinBootstrap.js
@@ -88,6 +88,9 @@
url += '&rootId=' + getConfig('rootId');
// Uri fragment
url += '&f=' + encodeURIComponent(location.hash);
+ if (window.name) {
+ url += '&wn=' + encodeURIComponent(window.name);
+ }
// Timestamp to avoid caching
url += '&' + (new Date()).getTime();
@@ -126,6 +129,11 @@
};
apps[appId] = app;
+ if (!window.name) {
+ var rootId = getConfig('rootId');
+ window.name = appId + '-' + rootId;
+ }
+
var bootstrapApp = function(mayDefer) {
var themeUri = getConfig('themeUri');
if (themeUri) {
diff --git a/src/com/vaadin/terminal/CombinedRequest.java b/src/com/vaadin/terminal/CombinedRequest.java
index b7608cd655..c589baad63 100644
--- a/src/com/vaadin/terminal/CombinedRequest.java
+++ b/src/com/vaadin/terminal/CombinedRequest.java
@@ -89,6 +89,10 @@ public class CombinedRequest implements WrappedRequest {
public String getUriFragmet() {
return secondRequest.getParameter("f");
}
+
+ public String getWindowName() {
+ return secondRequest.getParameter("wn");
+ }
};
}
diff --git a/src/com/vaadin/terminal/WrappedRequest.java b/src/com/vaadin/terminal/WrappedRequest.java
index e66800b28c..3d95ee7d00 100644
--- a/src/com/vaadin/terminal/WrappedRequest.java
+++ b/src/com/vaadin/terminal/WrappedRequest.java
@@ -35,6 +35,14 @@ public interface WrappedRequest extends Serializable {
* @return the URI hash fragment
*/
public String getUriFragmet();
+
+ /**
+ * Gets the value of window.name from the browser. This can be used to
+ * keep track of the specific window between browser reloads.
+ *
+ * @return the string value of window.name in the browser
+ */
+ public String getWindowName();
}
/**