Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Popup window and history.back

Posted on 2004-04-07
6
Medium Priority
?
913 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:ko78
  • 2
6 Comments
 
LVL 7

Expert Comment

by:TheKenman
ID: 10773359
Hi ko78,

Can I see a sample of your code?

Thanks.
0
 

Author Comment

by:ko78
ID: 10773484
<Script      language="javascript">
function drawbutton(name,link){
      document.write("<table cellpadding=0 cellspacing=0 class=button height=16><tr><td width='4' background='/PMResources/images/en/itworx/hedge2/btn_left.gif'></td><td nowrap background='/PMResources/images/en/itworx/hedge2/btn_middle.gif'><a class=button href='"+link+"'>"+name+"</td><td width=5 background='/PMResources/images/en/itworx/hedge2/btn_right.gif'></td></tr></table>");
}
function SearchForUser(){
      var features = 'top=0,left=0,width=480,height=300,toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, directories=no, status=no'
      var url = "/NASApp/pae/Loan_Request.npm?eventId=Itworx.SearchFieldUIEventHandler&__FieldName=SearchByName&__NodeName=Saved&boxValue=" + document.forms[0].SearchByName.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','javascript:SearchForUser()')
</script>
</td>

and the back button in page2 is

<td>
<script      language = "javascript">                                    
drawbutton("BACK","javascript:window.history.back();")
</script>
</td>
0
 
LVL 4

Accepted Solution

by:
tenacium earned 800 total points
ID: 10778580
My recommendation is when you click "change information", don't send them a browser "back" command.  Instead, bring them to JSP1 again and pass all the information again pre-populated.  It's much more reliable and improves user experience.  Since you pass the information from JSP1 to JSP2, I assume you know how to do it and it won't be that difficult to implement.  It's difficult to know what end-users are doing with their browsers and how that may affect your back button command.
0
 
LVL 7

Expert Comment

by:TheKenman
ID: 10778628
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question