ko78
asked on
Popup window and history.back
I have a JSP page page1.jsp which posts on another JSP page page2.jsp,
On page1.jsp there is a button that opens a popup window, when user submits page1 he can view a summary on page2 and can click back to change information, back is history.back, when he goes to page1.jsp all the data is there, unless he has clicked on the button to open the popup window on page 1 in this case when he clicks on back the data is gone
On page1.jsp there is a button that opens a popup window, when user submits page1 he can view a summary on page2 and can click back to change information, back is history.back, when he goes to page1.jsp all the data is there, unless he has clicked on the button to open the popup window on page 1 in this case when he clicks on back the data is gone
ASKER
<Script language="javascript">
function drawbutton(name,link){
document.write("<table cellpadding=0 cellspacing=0 class=button height=16><tr><td width='4' background='/PMResources/i mages/en/i tworx/hedg e2/btn_lef t.gif'></t d><td nowrap background='/PMResources/i mages/en/i tworx/hedg e2/btn_mid dle.gif'>< a class=button href='"+link+"'>"+name+"</ td><td width=5 background='/PMResources/i mages/en/i tworx/hedg e2/btn_rig ht.gif'></ td></tr></ table>");
}
function SearchForUser(){
var features = 'top=0,left=0,width=480,he ight=300,t oolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, directories=no, status=no'
var url = "/NASApp/pae/Loan_Request. npm?eventI d=Itworx.S earchField UIEventHan dler&__Fie ldName=Sea rchByName& __NodeName =Saved&box Value=" + document.forms[0].SearchBy Name.value + "&__rand=" + (new Date()).getTime()
var w = window.open(url,'FX_Search ',features );
w.focus();
}
</Script>
And this is written in the HTML
<td>
<script language="javascript">
drawbutton('SEARCH','javas cript:Sear chForUser( )')
</script>
</td>
and the back button in page2 is
<td>
<script language = "javascript">
drawbutton("BACK","javascr ipt:window .history.b ack();")
</script>
</td>
function drawbutton(name,link){
document.write("<table cellpadding=0 cellspacing=0 class=button height=16><tr><td width='4' background='/PMResources/i
}
function SearchForUser(){
var features = 'top=0,left=0,width=480,he
var url = "/NASApp/pae/Loan_Request.
var w = window.open(url,'FX_Search
w.focus();
}
</Script>
And this is written in the HTML
<td>
<script language="javascript">
drawbutton('SEARCH','javas
</script>
</td>
and the back button in page2 is
<td>
<script language = "javascript">
drawbutton("BACK","javascr
</script>
</td>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree.
When the pop-up is opened it takes the place of the 1st page in the browser history. Working around this would be much harder - and more likely to fail - than implementing data persistence.
When the pop-up is opened it takes the place of the 1st page in the browser history. Working around this would be much harder - and more likely to fail - than implementing data persistence.
Can I see a sample of your code?
Thanks.