File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes history.back() not retaining changed values in previous page after window.open() call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "history.back() not retaining changed values in previous page after window.open() call" Watch "history.back() not retaining changed values in previous page after window.open() call" New topic
Author

history.back() not retaining changed values in previous page after window.open() call

HemaLatha Biyyapu
Greenhorn

Joined: Dec 15, 2008
Posts: 1
Hi,

I have an issue with Back button.
I have page1.jsp and page2.jsp
page1 contains a simple textbox with default value 5 and a submit button.
Submit on page1 leads to page2.jsp which has two buttons 1.Back button
2. Popup button which opens a simple jsp with javascript window.open() method.

Now in a senario where
I change the value of the textbox to 20 and clicks on submit I will get page2.
Here if I click on back button without touching the popup window button I am able to retain the changed value 20 in previous page i.e, page1.
But if I open the popup window by clicking on popup button and after closing it if I click on back button I am going to page1 button the textbox value is getting reset to default value 5.

If I use showModalDialog() instead of window.open() to open the popup I am able to retain the values but I need to copy values from the popup window which is not possible through showModalDialog().

Can anyone suggest a way to retain the values in previous page on click of back button after window.open() call.

Thanks in advance.

Hema.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The browser is remembering the value and there is no way to tell it to remember it or not. If you want the browser to always remember it, you would have to basically remember the value in a check for it when the page loads.

Eric
 
 
subject: history.back() not retaining changed values in previous page after window.open() call
 
Similar Threads
Passing data from jsp to jsp to servlets to jsp (OR) NOT to process user's req again
open a popup window of a pop up window from the parent window
Navigation problem in struts
upon click of back button, go to logout page
Sending data to popup window