Solved

Popup window and history.back

Posted on 2004-04-07
6
898 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
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…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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…

636 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