If you need to refresh the page and keep the form data without resubmitting the POST, you may be able (depending of the size and complexity of your form data) to build a representation of the form state in JavaScript, store it in a cookie or the querystring, refresh the page by setting document.location.href, and then reload the data when the window loads.
Below is a rough version of this idea. This code along, with an onload wire-up, would go in the opener (the cookie handling methods would also need added). window.opener.refreshWithState() would be called from the popup.
(this version depends on inputs having unique IDs)
(function() {
window.refreshWithState = function() {
setCookie("state", buildState());
document.location.href = document.location.href;
};
function handleWindowLoad() {
var state = readCookie("state");
if (state) {
restoreState(state);
eraseCookie("state");
}
}
function buildState() {
var i, elem, elems, key, val, stateParts = [];
elems = document.getElementsByTagName('INPUT');
for (i = 0; elem = elems[i]; i++) {
switch (elem.type) {
case "checkbox":
case "radio":
val = elem.checked ? 1 : "";
break;
case "text":
case "hidden":
case "file":
val = escape(elem.value);
break;
default:
continue;
}
stateParts.push('"' + escape(elem.id) + '":"' + val + '"');
}
elems = document.getElementsByTagName('SELECT');
for (i = 0; elem = elems[i]; i++) {
stateParts.push('"' + escape(elem.id) + '":"' + elem.selectedIndex + '"');
}
return '{' + stateParts.join(',') + '}';
}
function restoreState(state) {
var key, elem, val;
var stateObj = eval('(' + state + ')');
for (key in stateObj) {
elem = document.getElementById(unescape(key));
if (!elem) {
continue;
}
val = stateObj[key];
if (elem.tagName == "SELECT") {
elem.selectedIndex = val;
}
else if (elem.tagName == "INPUT") {
switch (elem.type) {
case "checkbox":
case "radio":
elem.checked = !!val;
break;
case "text":
case "hidden":
case "file":
elem.value = unescape(val);
}
}
}
}
})();